Class VoxelShape

java.lang.Object
net.minecraft.world.phys.shapes.VoxelShape
Direct Known Subclasses:
ArrayVoxelShape, CubeVoxelShape, SliceShape

public abstract class VoxelShape extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • min

      public double min(Direction.Axis axis)
    • max

      public double max(Direction.Axis axis)
    • bounds

      public AABB bounds()
    • singleEncompassing

      public VoxelShape singleEncompassing()
    • get

      protected double get(Direction.Axis axis, int index)
    • getCoords

      public abstract it.unimi.dsi.fastutil.doubles.DoubleList getCoords(Direction.Axis axis)
    • isEmpty

      public boolean isEmpty()
    • move

      public VoxelShape move(double xOffset, double yOffset, double zOffset)
    • optimize

      public VoxelShape optimize()
    • forAllEdges

      public void forAllEdges(Shapes.DoubleLineConsumer action)
    • forAllBoxes

      public void forAllBoxes(Shapes.DoubleLineConsumer action)
    • toAabbs

      public List<AABB> toAabbs()
    • min

      public double min(Direction.Axis axis, double primaryPosition, double secondaryPosition)
    • max

      public double max(Direction.Axis axis, double primaryPosition, double secondaryPosition)
    • findIndex

      protected int findIndex(Direction.Axis axis, double position)
    • clip

      @Nullable public BlockHitResult clip(Vec3 startVec, Vec3 endVec, BlockPos pos)
    • closestPointTo

      public Optional<Vec3> closestPointTo(Vec3 point)
    • getFaceShape

      public VoxelShape getFaceShape(Direction side)
      Projects this shape onto the given side. For each box in the shape, if it does not touch the given side, it is eliminated. Otherwise, the box is extended in the given axis to cover the entire range [0, 1].
    • calculateFace

      private VoxelShape calculateFace(Direction side)
    • collide

      public double collide(Direction.Axis movementAxis, AABB collisionBox, double desiredOffset)
    • collideX

      protected double collideX(AxisCycle movementAxis, AABB collisionBox, double desiredOffset)
    • toString

      public String toString()
      Overrides:
      toString in class Object