Class BlockBox

java.lang.Object
net.minecraft.util.math.BlockBox

public class BlockBox
extends Object
A mutable box with integer coordinates. The box is axis-aligned and the coordinates are inclusive.

This box, though mutable, has proper hashCode and equals implementations and can be used as map keys if user can ensure they are not modified.

See Also:
Box
  • Field Details

    • minX

      public int minX
    • minY

      public int minY
    • minZ

      public int minZ
    • maxX

      public int maxX
    • maxY

      public int maxY
    • maxZ

      public int maxZ
  • Constructor Details

    • BlockBox

      public BlockBox()
    • BlockBox

      public BlockBox​(int[] data)
    • BlockBox

      public BlockBox​(BlockBox source)
    • BlockBox

      public BlockBox​(int minX, int minY, int minZ, int maxX, int maxY, int maxZ)
    • BlockBox

      public BlockBox​(Vec3i v1, Vec3i v2)
    • BlockBox

      public BlockBox​(int minX, int minZ, int maxX, int maxZ)
  • Method Details

    • empty

      public static BlockBox empty()
      Creates an empty box.
    • infinite

      public static BlockBox infinite()
    • rotated

      public static BlockBox rotated​(int x, int y, int z, int offsetX, int offsetY, int offsetZ, int sizeX, int sizeY, int sizeZ, Direction facing)
    • create

      public static BlockBox create​(int x1, int y1, int z1, int x2, int y2, int z2)
    • intersects

      public boolean intersects​(BlockBox other)
    • intersectsXZ

      public boolean intersectsXZ​(int minX, int minZ, int maxX, int maxZ)
    • encompass

      public void encompass​(BlockBox region)
    • move

      public void move​(int dx, int dy, int dz)
    • offset

      public BlockBox offset​(int x, int y, int z)
      Creates a new box that is translated by x, y, z on each axis from this box.
      Returns:
      the new box created
      See Also:
      move(int, int, int)
    • move

      public void move​(Vec3i vec3i)
    • contains

      public boolean contains​(Vec3i vec)
    • getDimensions

      public Vec3i getDimensions()
    • getBlockCountX

      public int getBlockCountX()
    • getBlockCountY

      public int getBlockCountY()
    • getBlockCountZ

      public int getBlockCountZ()
    • getCenter

      public Vec3i getCenter()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toNbt

      public NbtIntArray toNbt()