Class Column
java.lang.Object
net.minecraft.world.level.levelgen.Column
- Direct Known Subclasses:
Column.Line
,Column.Range
,Column.Ray
A representation of an integer valued interval, either bounded or unbounded.
While the class itself does not imply any coordinate in particular, this is practically used to represent a column in the Y direction.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
static final class
static final class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Column
above
(int floor) static Column.Range
around
(int floor, int ceiling) static Column
below
(int ceiling) static Column
create
(OptionalInt floor, OptionalInt ceiling) static Column
fromHighest
(int ceiling) static Column
fromLowest
(int floor) abstract OptionalInt
abstract OptionalInt
getFloor()
abstract OptionalInt
static Column.Range
inside
(int floor, int ceiling) static Column
line()
scan
(LevelSimulatedReader level, BlockPos pos, int maxDistance, Predicate<BlockState> columnPredicate, Predicate<BlockState> tipPredicate) Scans for a column of states satisfyingcolumnPredicate
, up to a length ofmaxDistance
from the origin, and ending with a state which satisfiestipPredicate
.private static OptionalInt
scanDirection
(LevelSimulatedReader level, int maxDistance, Predicate<BlockState> columnPredicate, Predicate<BlockState> tipPredicate, BlockPos.MutableBlockPos mutablePos, int startY, Direction direction) Scans for a sequence of states in a givendirection
, up to a length ofmaxDistance
which satisfycolumnPredicate
, and ending with a state which satisfiestipPredicate
.withCeiling
(OptionalInt ceiling) withFloor
(OptionalInt floor)
-
Constructor Details
-
Column
public Column()
-
-
Method Details
-
around
- Returns:
- A column of the closed interval [floor, ceiling].
-
inside
- Returns:
- A column of the open interval (floor, ceiling).
-
below
- Returns:
- A column of the unbounded interval (-infinity, ceiling).
-
fromHighest
- Returns:
- A column of the unbounded interval (-infinity, ceiling].
-
above
- Returns:
- A column of the unbounded interval (floor, infinity).
-
fromLowest
- Returns:
- A column of the unbounded interval [floor, infinity).
-
line
-
create
-
getCeiling
-
getFloor
-
getHeight
-
withFloor
-
withCeiling
-
scan
public static Optional<Column> scan(LevelSimulatedReader level, BlockPos pos, int maxDistance, Predicate<BlockState> columnPredicate, Predicate<BlockState> tipPredicate) Scans for a column of states satisfyingcolumnPredicate
, up to a length ofmaxDistance
from the origin, and ending with a state which satisfiestipPredicate
.- Returns:
- A column representing the tips found. The column will be bounded if a tip was reached in the given direction, unbounded otherwise.
-
scanDirection
private static OptionalInt scanDirection(LevelSimulatedReader level, int maxDistance, Predicate<BlockState> columnPredicate, Predicate<BlockState> tipPredicate, BlockPos.MutableBlockPos mutablePos, int startY, Direction direction) Scans for a sequence of states in a givendirection
, up to a length ofmaxDistance
which satisfycolumnPredicate
, and ending with a state which satisfiestipPredicate
.- Returns:
- The y position of the tip, if found.
-