Class DefaultConnectionPredicates

java.lang.Object
com.supermartijn642.fusion.api.predicate.DefaultConnectionPredicates

public final class DefaultConnectionPredicates extends Object
Used to create instances of the default ConnectionPredicates provided by Fusion.

Created 28/04/2023 by SuperMartijn642

  • Constructor Details

    • DefaultConnectionPredicates

      public DefaultConnectionPredicates()
  • Method Details

    • and

      public static ConnectionPredicate and(ConnectionPredicate... predicates)
      Combines the given predicates such that all predicates should be satisfied.
      Parameters:
      predicates - predicates which need to be satisfied
    • or

      public static ConnectionPredicate or(ConnectionPredicate... predicates)
      Combines the given predicates such that at least one predicate should be satisfied.
      Parameters:
      predicates - predicates of which any must be satisfied
    • not

      public static ConnectionPredicate not(ConnectionPredicate predicate)
      Inverts the given predicate.
      Parameters:
      predicate - predicate of which the inverse will be taken
    • isFaceVisible

      public static ConnectionPredicate isFaceVisible()
      Creates a predicate which is satisfied if the block in the connection direction is visible.
    • isSameBlock

      public static ConnectionPredicate 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

      public static ConnectionPredicate 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

      public static ConnectionPredicate matchBlock(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.
      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 matched
      properties - 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