Package com.minecolonies.api.util
Class ShapeUtil
java.lang.Object
com.minecolonies.api.util.ShapeUtil
Utility methods for dealing with voxel shapes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doublegetEndY(net.minecraft.world.phys.shapes.VoxelShape bb, double def) Get the end y of a voxelshape.static doublegetStartY(net.minecraft.world.phys.shapes.VoxelShape bb, double def) Get the start y of a voxelshape.static booleanhasCollision(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.phys.shapes.VoxelShape collisionShape) Check if the given block has a collision shapestatic booleanhasCollision(net.minecraft.world.level.BlockGetter world, int x, int y, int z, net.minecraft.world.level.block.state.BlockState state) Check if the given block has a collision shapestatic booleanhasCollision(net.minecraft.world.level.BlockGetter world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) Check if the given block has a collision shapestatic booleanisEmpty(net.minecraft.world.phys.shapes.VoxelShape shape) Check if a shape is emptystatic doublemax(net.minecraft.world.phys.shapes.VoxelShape shape, net.minecraft.core.Direction.Axis axis) Fast shape max for normal blocksstatic doublemin(net.minecraft.world.phys.shapes.VoxelShape shape, net.minecraft.core.Direction.Axis axis) Fast shape min for normal Blocks
-
Constructor Details
-
ShapeUtil
public ShapeUtil()
-
-
Method Details
-
max
public static double max(net.minecraft.world.phys.shapes.VoxelShape shape, net.minecraft.core.Direction.Axis axis) Fast shape max for normal blocks- Parameters:
shape-axis-- Returns:
-
min
public static double min(net.minecraft.world.phys.shapes.VoxelShape shape, net.minecraft.core.Direction.Axis axis) Fast shape min for normal Blocks- Parameters:
shape-axis-- Returns:
-
isEmpty
public static boolean isEmpty(net.minecraft.world.phys.shapes.VoxelShape shape) Check if a shape is empty- Parameters:
shape-- Returns:
-
getStartY
public static double getStartY(net.minecraft.world.phys.shapes.VoxelShape bb, double def) Get the start y of a voxelshape.- Parameters:
bb- the voxelshape.def- the default if empty.- Returns:
- the start y.
-
getEndY
public static double getEndY(net.minecraft.world.phys.shapes.VoxelShape bb, double def) Get the end y of a voxelshape.- Parameters:
bb- the voxelshape.def- the default if empty.- Returns:
- the end y.
-
hasCollision
public static boolean hasCollision(net.minecraft.world.level.BlockGetter world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) Check if the given block has a collision shape- Parameters:
world-pos-state-- Returns:
-
hasCollision
public static boolean hasCollision(net.minecraft.world.level.BlockGetter world, int x, int y, int z, net.minecraft.world.level.block.state.BlockState state) Check if the given block has a collision shape- Parameters:
world-pos-state-- Returns:
-
hasCollision
public static boolean hasCollision(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.phys.shapes.VoxelShape collisionShape) Check if the given block has a collision shape- Parameters:
state-collisionShape-- Returns:
-