Interface ConnectionPredicate
- All Known Subinterfaces:
SensitiveConnectionPredicate
- All Known Implementing Classes:
AndConnectionPredicate,IsFaceVisibleConnectionPredicate,IsSameBlockConnectionPredicate,IsSameStateConnectionPredicate,MatchBlockConnectionPredicate,MatchStateConnectionPredicate,NotConnectionPredicate,OrConnectionPredicate
public interface ConnectionPredicate
A predicate used to determine whether a model should connect to with another block.
Created 27/04/2023 by SuperMartijn642
-
Method Summary
Modifier and TypeMethodDescriptiondefault ConnectionPredicateand(ConnectionPredicate... predicates) Adds a requirement to this predicate.Serializer<? extends ConnectionPredicate>default booleanDetermines whether this connection predicate depends on the level and should always be reevaluated.default ConnectionPredicatenegate()Negates the output of this resource condition.default ConnectionPredicateor(ConnectionPredicate... predicates) Adds an alternative to this predicate.booleanshouldConnect(net.minecraft.core.Direction side, @Nullable net.minecraft.world.level.block.state.BlockState ownState, net.minecraft.world.level.block.state.BlockState otherState, net.minecraft.world.level.block.state.BlockState blockInFront, ConnectionDirection direction) Determines whether the model should connect to the given direction.default booleanshouldConnect(net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, @Nullable net.minecraft.world.level.block.state.BlockState ownState, net.minecraft.world.level.block.state.BlockState otherState, net.minecraft.world.level.block.state.BlockState blockInFront, ConnectionDirection direction) Determines whether the model should connect to the given direction.
-
Method Details
-
shouldConnect
boolean shouldConnect(net.minecraft.core.Direction side, @Nullable @Nullable net.minecraft.world.level.block.state.BlockState ownState, net.minecraft.world.level.block.state.BlockState otherState, net.minecraft.world.level.block.state.BlockState blockInFront, ConnectionDirection direction) Determines whether the model should connect to the given direction.- Parameters:
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 ofotherstatedirection- direction to check- Returns:
trueif the texture should connect in the given direction- Throws:
IllegalStateException- when the predicate is sensitive, i.e.isSensitive()returnstrue
-
shouldConnect
default boolean shouldConnect(net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, @Nullable @Nullable net.minecraft.world.level.block.state.BlockState ownState, net.minecraft.world.level.block.state.BlockState otherState, net.minecraft.world.level.block.state.BlockState blockInFront, ConnectionDirection direction) Determines whether the model should connect to the given direction. Sensitive version ofshouldConnect(Direction, BlockState, BlockState, BlockState, ConnectionDirection). If this method should be used,isSensitive()must returntrue.- Parameters:
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 ofotherstatedirection- direction to check- Returns:
trueif the texture should connect in the given direction
-
isSensitive
default boolean isSensitive()Determines whether this connection predicate depends on the level and should always be reevaluated. Iftrueis returnedshouldConnect(Direction, BlockState, BlockState, BlockState, ConnectionDirection)may throw anIllegalStateException. Iffalseis returned, it is assumed that the connection predicate may be cached for the values supplied inshouldConnect(Direction, BlockState, BlockState, BlockState, ConnectionDirection).- See Also:
-
getSerializer
Serializer<? extends ConnectionPredicate> getSerializer()- Returns:
- the serializer for this predicate
-
and
Adds a requirement to this predicate. -
or
Adds an alternative to this predicate. -
negate
Negates the output of this resource condition.
-