public static final class BlockState.StateMatcher extends Object implements Predicate<BlockState>
BlockState matcher that will match various block states
according to a pre-built list of BlockTraits and their
values, such that not all BlockTraits contained in a
BlockState must be matched. (Such as if a block state
that contains 4 traits, and only 2 are wanting to be matched,
then the other two traits may be variable).| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
List<BlockState> |
getCompatibleStates()
Gets a
List of compatible BlockStates. |
int |
hashCode() |
boolean |
matches(BlockState state)
Gets a
true return value if the provided BlockState
sufficiently matches this matcher, such that the BlockType
matches, and the pre-defined BlockTrait values match. |
boolean |
test(BlockState blockState) |
String |
toString() |
public boolean matches(BlockState state)
true return value if the provided BlockState
sufficiently matches this matcher, such that the BlockType
matches, and the pre-defined BlockTrait values match.state - The block state in questionpublic boolean test(BlockState blockState)
test in interface Predicate<BlockState>public List<BlockState> getCompatibleStates()
List of compatible BlockStates.
Since all BlockStates are known in the initialization
of a BlockType, the states are already deterministic
and cannot change themselves.