Package org.spongepowered.api.state
Interface StateMatcher<S extends State<S>>
-
- All Superinterfaces:
Predicate<S>
public interface StateMatcher<S extends State<S>> extends Predicate<S>
AStateMatcherthat will match variousStates according to a pre-built list ofStatePropertys and their values, such that not allStatePropertys contained in aStatemust be matched.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceStateMatcher.Builder<S extends State<S>,T extends StateContainer<S>>A builder forStateMatchers.static interfaceStateMatcher.FactoryFactories 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.Builderfor matchingBlockStates.List<S>compatibleStates()static StateMatcher.Builder<FluidState,FluidType>fluidStateMatcherBuilder()Creates a newStateMatcher.Builderfor matchingFluidStates.booleanmatches(S state)Gets atruereturn value if the providedStatesufficiently matches the pre-definedStatePropertyvalues andKeyValueMatchers.default booleantest(S state)
-
-
-
Method Detail
-
blockStateMatcherBuilder
static StateMatcher.Builder<BlockState,BlockType> blockStateMatcherBuilder()
Creates a newStateMatcher.Builderfor matchingBlockStates.- Returns:
- The builder
-
fluidStateMatcherBuilder
static StateMatcher.Builder<FluidState,FluidType> fluidStateMatcherBuilder()
Creates a newStateMatcher.Builderfor matchingFluidStates.- Returns:
- The builder
-
matches
boolean matches(S state)
Gets atruereturn value if the providedStatesufficiently matches the pre-definedStatePropertyvalues andKeyValueMatchers.- Parameters:
state- The state in question- Returns:
- True if the state sufficiently matches
-
-