Enum Class ContraptionMovementSetting

java.lang.Object
java.lang.Enum<ContraptionMovementSetting>
com.simibubi.create.api.contraption.ContraptionMovementSetting
All Implemented Interfaces:
Serializable, Comparable<ContraptionMovementSetting>, Constable

public enum ContraptionMovementSetting extends Enum<ContraptionMovementSetting>
Defines whether a block is movable by contraptions. This is used as a fallback check for BlockMovementChecks.isMovementAllowed(BlockState, Level, BlockPos). The registry uses suppliers, so the setting of a block can change. This is useful for config options.
  • Enum Constant Details

    • MOVABLE

      public static final ContraptionMovementSetting MOVABLE
      Block is fully movable with no restrictions.
    • NO_PICKUP

      public static final ContraptionMovementSetting NO_PICKUP
      Block can be mounted and moved, but if it's on a minecart contraption, the contraption cannot be picked up.
    • UNMOVABLE

      public static final ContraptionMovementSetting UNMOVABLE
      Block cannot ever be moved by a contraption.
  • Field Details

  • Method Details

    • values

      public static ContraptionMovementSetting[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ContraptionMovementSetting valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • get

      @Nullable public static @Nullable ContraptionMovementSetting get(net.minecraft.world.level.block.state.BlockState state)
      Shortcut that gets the block of the given state.
    • get

      @Nullable public static @Nullable ContraptionMovementSetting get(net.minecraft.world.level.block.Block block)
      Get the current movement setting of the given block.
    • anyAre

      public static boolean anyAre(Collection<net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo> blocks, ContraptionMovementSetting setting)
      Check if any of the blocks in the collection match the given setting.
    • isNoPickup

      public static boolean isNoPickup(Collection<net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo> blocks)
      Check if any of the blocks in the collection forbid pickup.