Class DefaultConnectionPredicates
java.lang.Object
com.supermartijn642.fusion.api.predicate.DefaultConnectionPredicates
Used to create instances of the default
ConnectionPredicates provided by Fusion.
Created 28/04/2023 by SuperMartijn642
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ConnectionPredicateand(ConnectionPredicate... predicates) Combines the given predicates such that all predicates should be satisfied.static ConnectionPredicateCreates a predicate which is satisfied if the block in the connection direction is visible.static ConnectionPredicateCreates a predicate which is satisfied if the block in the connection direction is the same as the block of the model itself.static ConnectionPredicateCreates a predicate which is satisfied if the block state in the connection direction is the same as the block state of the model itself.static ConnectionPredicatematchBlock(net.minecraft.world.level.block.Block block) Creates a predicate which is satisfied if the block in the connection direction is the same as the provided block.static ConnectionPredicatematchState(net.minecraft.world.level.block.Block block, Pair<net.minecraft.world.level.block.state.properties.Property<?>, ?>... properties) Creates a predicate which is satisfied if the state in the connection direction is the same as the provided block and matches the provided properties.static ConnectionPredicatematchState(net.minecraft.world.level.block.state.BlockState state) Creates a predicate which is satisfied if the state in the connection direction is the same as the provided state.static ConnectionPredicatenot(ConnectionPredicate predicate) Inverts the given predicate.static ConnectionPredicateor(ConnectionPredicate... predicates) Combines the given predicates such that at least one predicate should be satisfied.
-
Constructor Details
-
DefaultConnectionPredicates
public DefaultConnectionPredicates()
-
-
Method Details
-
and
Combines the given predicates such that all predicates should be satisfied.- Parameters:
predicates- predicates which need to be satisfied
-
or
Combines the given predicates such that at least one predicate should be satisfied.- Parameters:
predicates- predicates of which any must be satisfied
-
not
Inverts the given predicate.- Parameters:
predicate- predicate of which the inverse will be taken
-
isFaceVisible
Creates a predicate which is satisfied if the block in the connection direction is visible. -
isSameBlock
Creates a predicate which is satisfied if the block in the connection direction is the same as the block of the model itself. -
isSameState
Creates a predicate which is satisfied if the block state in the connection direction is the same as the block state of the model itself. -
matchBlock
Creates a predicate which is satisfied if the block in the connection direction is the same as the provided block.- Parameters:
block- block which should be matched
-
matchState
public static ConnectionPredicate matchState(net.minecraft.world.level.block.Block block, Pair<net.minecraft.world.level.block.state.properties.Property<?>, ?>... properties) Creates a predicate which is satisfied if the state in the connection direction is the same as the provided block and matches the provided properties.- Parameters:
block- block which should be matchedproperties- property value pairs which should be matched
-
matchState
public static ConnectionPredicate matchState(net.minecraft.world.level.block.state.BlockState state) Creates a predicate which is satisfied if the state in the connection direction is the same as the provided state.- Parameters:
state- state which should be matched
-