Class ShapeUtil

java.lang.Object
com.minecolonies.api.util.ShapeUtil

public class ShapeUtil extends Object
Utility methods for dealing with voxel shapes
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    getEndY(net.minecraft.world.phys.shapes.VoxelShape bb, double def)
    Get the end y of a voxelshape.
    static double
    getStartY(net.minecraft.world.phys.shapes.VoxelShape bb, double def)
    Get the start y of a voxelshape.
    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
    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
    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
    static boolean
    isEmpty(net.minecraft.world.phys.shapes.VoxelShape shape)
    Check if a shape is empty
    static double
    max(net.minecraft.world.phys.shapes.VoxelShape shape, net.minecraft.core.Direction.Axis axis)
    Fast shape max for normal blocks
    static double
    min(net.minecraft.world.phys.shapes.VoxelShape shape, net.minecraft.core.Direction.Axis axis)
    Fast shape min for normal Blocks

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 -
      state -
      pos -
      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: