Interface ConnectionPredicate

All Known Implementing Classes:
AndConnectionPredicate, IsSameBlockConnectionPredicate, IsSameStateConnectionPredicate, MatchBlockConnectionPredicate, 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 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 on
      ownState - state of the block itself
      otherState - state of the block in the connection direction
      blockInFront - state in front of otherstate
      direction - direction to check
      Returns:
      true if the texture should connect in the given direction
    • getSerializer

      Serializer<? extends ConnectionPredicate> getSerializer()
      Returns:
      the serializer for this predicate
    • and

      default ConnectionPredicate and(ConnectionPredicate... predicates)
      Adds a requirement to this predicate.
    • or

      default ConnectionPredicate or(ConnectionPredicate... predicates)
      Adds an alternative to this predicate.
    • negate

      default ConnectionPredicate negate()
      Negates the output of this resource condition.