Package org.spongepowered.api.state
Interface StateMatcher<S extends State<S>>
-
- All Superinterfaces:
java.util.function.Predicate<S>
public interface StateMatcher<S extends State<S>> extends java.util.function.Predicate<S>
AStateMatcher
that will match variousState
s according to a pre-built list ofStateProperty
s and their values, such that not allStateProperty
s contained in aState
must be matched.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
StateMatcher.Builder<S extends State<S>,T extends StateContainer<S>>
A builder forStateMatcher
s.static interface
StateMatcher.Factory
Factories for generating builders.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static StateMatcher.Builder<BlockState,BlockType>
blockStateMatcherBuilder()
Creates a newStateMatcher.Builder
for matchingBlockState
s.java.util.List<S>
compatibleStates()
Gets aList
of compatibleState
s.static StateMatcher.Builder<FluidState,FluidType>
fluidStateMatcherBuilder()
Creates a newStateMatcher.Builder
for matchingFluidState
s.boolean
matches(S state)
Gets atrue
return value if the providedState
sufficiently matches the pre-definedStateProperty
values andKeyValueMatcher
s.default boolean
test(S state)
-
-
-
Method Detail
-
blockStateMatcherBuilder
static StateMatcher.Builder<BlockState,BlockType> blockStateMatcherBuilder()
Creates a newStateMatcher.Builder
for matchingBlockState
s.- Returns:
- The builder
-
fluidStateMatcherBuilder
static StateMatcher.Builder<FluidState,FluidType> fluidStateMatcherBuilder()
Creates a newStateMatcher.Builder
for matchingFluidState
s.- Returns:
- The builder
-
matches
boolean matches(S state)
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
java.util.List<S> compatibleStates()
Gets aList
of compatibleState
s.- Returns:
- The list of compatible states
-
-