Enum Class ContraptionMovementSetting
java.lang.Object
java.lang.Enum<ContraptionMovementSetting>
com.simibubi.create.api.contraption.ContraptionMovementSetting
- All Implemented Interfaces:
Serializable,Comparable<ContraptionMovementSetting>,Constable
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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInterface that may optionally be implemented on a Block implementation which will be queried instead of the registry.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SimpleRegistry<net.minecraft.world.level.block.Block, Supplier<ContraptionMovementSetting>> -
Method Summary
Modifier and TypeMethodDescriptionstatic booleananyAre(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.static ContraptionMovementSettingget(net.minecraft.world.level.block.Block block) Get the current movement setting of the given block.static ContraptionMovementSettingget(net.minecraft.world.level.block.state.BlockState state) Shortcut that gets the block of the given state.static booleanisNoPickup(Collection<net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo> blocks) Check if any of the blocks in the collection forbid pickup.static ContraptionMovementSettingReturns the enum constant of this class with the specified name.static ContraptionMovementSetting[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MOVABLE
Block is fully movable with no restrictions. -
NO_PICKUP
Block can be mounted and moved, but if it's on a minecart contraption, the contraption cannot be picked up. -
UNMOVABLE
Block cannot ever be moved by a contraption.
-
-
Field Details
-
REGISTRY
public static final SimpleRegistry<net.minecraft.world.level.block.Block,Supplier<ContraptionMovementSetting>> REGISTRY
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
get
@Nullable public static ContraptionMovementSetting get(net.minecraft.world.level.block.state.BlockState state) Shortcut that gets the block of the given state. -
get
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.
-