Package org.spongepowered.api.state
Interface StateMatcher<S extends State<S>>
- All Superinterfaces:
Predicate<S>
A
StateMatcher
that will match various State
s
according to a pre-built list of StateProperty
s and their
values, such that not all StateProperty
s contained in a
State
must be matched.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
StateMatcher.Builder<S extends State<S>,
T extends StateContainer<S>> A builder forStateMatcher
s.static interface
Factories for generating builders. -
Method Summary
Modifier and TypeMethodDescriptionstatic StateMatcher.Builder
<BlockState, BlockType> Creates a newStateMatcher.Builder
for matchingBlockState
s.static StateMatcher.Builder
<FluidState, FluidType> Creates a newStateMatcher.Builder
for matchingFluidState
s.boolean
Gets atrue
return value if the providedState
sufficiently matches the pre-definedStateProperty
values andKeyValueMatcher
s.default boolean
-
Method Details
-
blockStateMatcherBuilder
Creates a newStateMatcher.Builder
for matchingBlockState
s.- Returns:
- The builder
-
fluidStateMatcherBuilder
Creates a newStateMatcher.Builder
for matchingFluidState
s.- Returns:
- The builder
-
matches
Gets atrue
return value if the providedState
sufficiently matches the pre-definedStateProperty
values andKeyValueMatcher
s.- Parameters:
state
- The state in question- Returns:
- True if the state sufficiently matches
-
compatibleStates
- Returns:
- The list of compatible states
-
test
-