Package net.minecraft.util.math
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 Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description booleancontains(Vec3i vec)static BlockBoxcreate(int x1, int y1, int z1, int x2, int y2, int z2)static BlockBoxempty()Creates an empty box.voidencompass(BlockBox region)intgetBlockCountX()intgetBlockCountY()intgetBlockCountZ()Vec3igetCenter()Vec3igetDimensions()static BlockBoxinfinite()booleanintersects(BlockBox other)booleanintersectsXZ(int minX, int minZ, int maxX, int maxZ)voidmove(int dx, int dy, int dz)voidmove(Vec3i vec3i)BlockBoxoffset(int x, int y, int z)Creates a new box that is translated byx,y,zon each axis from this box.static BlockBoxrotated(int x, int y, int z, int offsetX, int offsetY, int offsetZ, int sizeX, int sizeY, int sizeZ, Direction facing)NbtIntArraytoNbt()StringtoString()
-
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
-
BlockBox
public BlockBox(int minX, int minY, int minZ, int maxX, int maxY, int maxZ) -
BlockBox
-
BlockBox
public BlockBox(int minX, int minZ, int maxX, int maxZ)
-
-
Method Details
-
empty
Creates an empty box. -
infinite
-
rotated
-
create
-
intersects
-
intersectsXZ
public boolean intersectsXZ(int minX, int minZ, int maxX, int maxZ) -
encompass
-
move
public void move(int dx, int dy, int dz) -
offset
Creates a new box that is translated byx,y,zon each axis from this box.- Returns:
- the new box created
- See Also:
move(int, int, int)
-
move
-
contains
-
getDimensions
-
getBlockCountX
public int getBlockCountX() -
getBlockCountY
public int getBlockCountY() -
getBlockCountZ
public int getBlockCountZ() -
getCenter
-
toString
-
toNbt
-