public interface ConnectionPredicate
Created 27/04/2023 by SuperMartijn642
| Modifier and Type | Method and Description |
|---|---|
default ConnectionPredicate |
and(ConnectionPredicate... predicates)
Adds a requirement to this predicate.
|
Serializer<? extends ConnectionPredicate> |
getSerializer() |
default boolean |
isSensitive()
Determines whether this connection predicate depends on the level and should always be reevaluated.
|
default ConnectionPredicate |
negate()
Negates the output of this resource condition.
|
default ConnectionPredicate |
or(ConnectionPredicate... predicates)
Adds an alternative to this predicate.
|
boolean |
shouldConnect(net.minecraft.util.Direction side,
net.minecraft.block.BlockState ownState,
net.minecraft.block.BlockState otherState,
net.minecraft.block.BlockState blockInFront,
ConnectionDirection direction)
Determines whether the model should connect to the given direction.
|
default boolean |
shouldConnect(net.minecraft.world.IBlockReader level,
net.minecraft.util.math.BlockPos pos,
net.minecraft.util.Direction side,
net.minecraft.block.BlockState ownState,
net.minecraft.block.BlockState otherState,
net.minecraft.block.BlockState blockInFront,
ConnectionDirection direction)
Determines whether the model should connect to the given direction.
|
boolean shouldConnect(net.minecraft.util.Direction side,
@Nullable
net.minecraft.block.BlockState ownState,
net.minecraft.block.BlockState otherState,
net.minecraft.block.BlockState blockInFront,
ConnectionDirection direction)
side - side of the block which the relevant texture is onownState - state of the block itselfotherState - state of the block in the connection directionblockInFront - state in front of otherstatedirection - direction to checktrue if the texture should connect in the given directionjava.lang.IllegalStateException - when the predicate is sensitive, i.e. isSensitive() returns truedefault boolean shouldConnect(net.minecraft.world.IBlockReader level,
net.minecraft.util.math.BlockPos pos,
net.minecraft.util.Direction side,
@Nullable
net.minecraft.block.BlockState ownState,
net.minecraft.block.BlockState otherState,
net.minecraft.block.BlockState blockInFront,
ConnectionDirection direction)
shouldConnect(Direction, BlockState, BlockState, BlockState, ConnectionDirection).
If this method should be used, isSensitive() must return true.side - side of the block which the relevant texture is onownState - state of the block itselfotherState - state of the block in the connection directionblockInFront - state in front of otherstatedirection - direction to checktrue if the texture should connect in the given directiondefault boolean isSensitive()
true is returned shouldConnect(Direction, BlockState, BlockState, BlockState, ConnectionDirection) may throw an IllegalStateException.
If false is returned, it is assumed that the connection predicate may be cached for the values supplied in shouldConnect(Direction, BlockState, BlockState, BlockState, ConnectionDirection).SensitiveConnectionPredicateSerializer<? extends ConnectionPredicate> getSerializer()
default ConnectionPredicate and(ConnectionPredicate... predicates)
default ConnectionPredicate or(ConnectionPredicate... predicates)
default ConnectionPredicate negate()