Class BlockMovementChecks
java.lang.Object
com.simibubi.create.api.contraption.BlockMovementChecks
Provides several interfaces that can define the behavior of blocks when mounting onto contraptions:
BlockMovementChecks.MovementNecessaryCheckBlockMovementChecks.MovementAllowedCheckBlockMovementChecks.BrittleCheckBlockMovementChecks.AttachedCheckBlockMovementChecks.NotSupportiveCheck
For each interface, checks can be registered and queried.
Registration is thread-safe and can be done in parallel mod init.
Each query will iterate all registered checks of that type in reverse-registration order. If a check returns
a non-PASS result, that is the result of the query. If no check catches a query, then
a best-effort fallback is used.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interfacestatic enumstatic interfacestatic interfacestatic interface -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisBlockAttachedTowards(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction direction) static booleanisBrittle(net.minecraft.world.level.block.state.BlockState state) static booleanisMovementAllowed(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) static booleanisMovementNecessary(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) static booleanisNotSupportive(net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.Direction facing) static voidstatic voidstatic voidstatic voidstatic void
-
Method Details
-
registerMovementNecessaryCheck
-
registerMovementAllowedCheck
-
registerBrittleCheck
-
registerAttachedCheck
-
registerNotSupportiveCheck
-
isMovementNecessary
public static boolean isMovementNecessary(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) -
isMovementAllowed
public static boolean isMovementAllowed(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) -
isBrittle
public static boolean isBrittle(net.minecraft.world.level.block.state.BlockState state) -
isBlockAttachedTowards
public static boolean isBlockAttachedTowards(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction direction) -
isNotSupportive
public static boolean isNotSupportive(net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.Direction facing)
-