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 classstatic final classstatic final class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Columnabove(int pFloor) static Column.Rangearound(int pFloor, int pCeiling) static Columnbelow(int pCeiling) static Columncreate(OptionalInt pFloor, OptionalInt pCeiling) static ColumnfromHighest(int pCeiling) static ColumnfromLowest(int pFloor) abstract OptionalIntabstract OptionalIntgetFloor()abstract OptionalIntstatic Column.Rangeinside(int pFloor, int pCeiling) static Columnline()scan(LevelSimulatedReader pLevel, BlockPos pPos, int pMaxDistance, Predicate<BlockState> pColumnPredicate, Predicate<BlockState> pTipPredicate) Scans for a column of states satisfyingcolumnPredicate, up to a length ofmaxDistancefrom the origin, and ending with a state which satisfiestipPredicate.private static OptionalIntscanDirection(LevelSimulatedReader pLevel, int pMaxDistance, Predicate<BlockState> pColumnPredicate, Predicate<BlockState> pTipPredicate, BlockPos.MutableBlockPos pMutablePos, int pStartY, Direction pDirection) Scans for a sequence of states in a givendirection, up to a length ofmaxDistancewhich satisfycolumnPredicate, and ending with a state which satisfiestipPredicate.withCeiling(OptionalInt pCeiling) withFloor(OptionalInt pFloor)
-
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 pLevel, BlockPos pPos, int pMaxDistance, Predicate<BlockState> pColumnPredicate, Predicate<BlockState> pTipPredicate) Scans for a column of states satisfyingcolumnPredicate, up to a length ofmaxDistancefrom 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 pLevel, int pMaxDistance, Predicate<BlockState> pColumnPredicate, Predicate<BlockState> pTipPredicate, BlockPos.MutableBlockPos pMutablePos, int pStartY, Direction pDirection) Scans for a sequence of states in a givendirection, up to a length ofmaxDistancewhich satisfycolumnPredicate, and ending with a state which satisfiestipPredicate.- Returns:
- The y position of the tip, if found.
-