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 pFloor) static Column.Range
around
(int pFloor, int pCeiling) static Column
below
(int pCeiling) static Column
create
(OptionalInt pFloor, OptionalInt pCeiling) static Column
fromHighest
(int pCeiling) static Column
fromLowest
(int pFloor) abstract OptionalInt
abstract OptionalInt
getFloor()
abstract OptionalInt
static Column.Range
inside
(int pFloor, int pCeiling) static Column
line()
scan
(LevelSimulatedReader pLevel, BlockPos pPos, int pMaxDistance, Predicate<BlockState> pColumnPredicate, Predicate<BlockState> pTipPredicate) 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 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 ofmaxDistance
which 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 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 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 ofmaxDistance
which satisfycolumnPredicate
, and ending with a state which satisfiestipPredicate
.- Returns:
- The y position of the tip, if found.
-