Class BlockMatcher
java.lang.Object
net.minecraft.world.level.blockscan.BlockMatcher
- Direct Known Subclasses:
BoxBlockMatcher, OrderedBlockMatcher
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final LevelReader(package private) static final BiPredicate<BlockState, BlockPos> private static final Predicate<BlockState> protected BiPredicate<BlockState, BlockPos> protected Predicate<BlockState> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanprotected booleananyMatched(Predicate<BlockState> statePredicate) protected abstract booleananyMatched(Predicate<BlockState> statePredicate, BiPredicate<BlockState, BlockPos> predicate) abstract booleanatLeastMatched(int n) booleanatMostMatched(int n) filterPosition(BiPredicate<BlockState, BlockPos> predicate) Neo: Filter against the state and position context, after the states are filtered.filterState(Predicate<BlockState> predicate) abstract voidforEach(BiConsumer<BlockPos, BlockState> consumer) abstract booleanforEachUntil(BlockStateConsumer consumer) boolean
-
Field Details
-
NO_PREDICATE
-
NO_POSITION_PREDICATE
-
level
-
statePredicate
-
positionPredicate
-
-
Constructor Details
-
BlockMatcher
-
-
Method Details
-
filterState
-
filterPosition
Neo: Filter against the state and position context, after the states are filtered. This is only called for positions that the block state filter did not reject.
All filters registered using this method are applied in sequence, so only the intersection of all filters are matched.
The position passed to this method may be mutable; do not modify it or store it directly without first making it immutable.
For filtering out states without reference to the position, prefer using
filterState(Predicate).- Parameters:
predicate- a filter based on state and (mutable) position- Returns:
- this matcher, for chaining
-
atLeastMatched
public abstract boolean atLeastMatched(int n) -
atMostMatched
public boolean atMostMatched(int n) -
anyMatched
public boolean anyMatched() -
anyMatched
-
anyMatched
protected abstract boolean anyMatched(Predicate<BlockState> statePredicate, BiPredicate<BlockState, BlockPos> predicate) -
noneMatched
public boolean noneMatched() -
allMatched
public boolean allMatched() -
forEach
-
forEachUntil
-