Package net.minecraft.util.math
Class BlockBox
java.lang.Object
net.minecraft.util.math.BlockBox
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:
- Mappings:
- Namespace - Name - official - drs- intermediary - net/minecraft/class_3341- named - net/minecraft/util/math/BlockBox
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleancontains(int x, int y, int z) booleanReturns whether this box containspos.static BlockBoxReturns a new box from two corners,firstandsecond.Returns the minimum box encompassing all of the givenboxes, or an empty optional ifboxesis empty.Deprecated.Deprecated.encompassPositions(Iterable<BlockPos> positions) Returns the minimum box encompassing all of the givenpositions, or an empty optional ifpositionsis empty.booleanexpand(int offset) Returns a new box that is expanded on each direction byoffset.voidforEachVertex(Consumer<BlockPos> consumer) Callsconsumerfor each vertex (corner) of this box.intReturns the number of blocks on the X axis.intReturns the number of blocks on the Y axis.intReturns the number of blocks on the Z axis.Returns the center of this box.Returns the dimensions (the size) of this box.intgetMaxX()intgetMaxY()intgetMaxZ()intgetMinX()intgetMinY()intgetMinZ()inthashCode()static BlockBoxinfinite()Returns a new all-encompassing, infinite box.booleanintersects(BlockBox other) Returns whetherotherintersects with this box.booleanintersectsXZ(int minX, int minZ, int maxX, int maxZ) Returns whether the rectangle from the given coordinates intersects with this box's XZ plane.move(int dx, int dy, int dz) Deprecated.Deprecated.offset(int x, int y, int z) Returns 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) toString()
- 
Field Details- 
LOGGER- Mappings:
- Namespace - Name - Mixin selector - official - b- Ldrs;b:Lorg/slf4j/Logger;- intermediary - field_31548- Lnet/minecraft/class_3341;field_31548:Lorg/slf4j/Logger;- named - LOGGER- Lnet/minecraft/util/math/BlockBox;LOGGER:Lorg/slf4j/Logger;
 
- 
CODECA codec that stores a block box as an int array. In the serialized array, the ordered elements areminX,minY,minZ,maxX,maxY,maxZ.- Mappings:
- Namespace - Name - Mixin selector - official - a- Ldrs;a:Lcom/mojang/serialization/Codec;- intermediary - field_29325- Lnet/minecraft/class_3341;field_29325:Lcom/mojang/serialization/Codec;- named - CODEC- Lnet/minecraft/util/math/BlockBox;CODEC:Lcom/mojang/serialization/Codec;
 
- 
minXprivate int minX- Mappings:
- Namespace - Name - Mixin selector - official - c- Ldrs;c:I- intermediary - field_14380- Lnet/minecraft/class_3341;field_14380:I- named - minX- Lnet/minecraft/util/math/BlockBox;minX:I
 
- 
minYprivate int minY- Mappings:
- Namespace - Name - Mixin selector - official - d- Ldrs;d:I- intermediary - field_14379- Lnet/minecraft/class_3341;field_14379:I- named - minY- Lnet/minecraft/util/math/BlockBox;minY:I
 
- 
minZprivate int minZ- Mappings:
- Namespace - Name - Mixin selector - official - e- Ldrs;e:I- intermediary - field_14378- Lnet/minecraft/class_3341;field_14378:I- named - minZ- Lnet/minecraft/util/math/BlockBox;minZ:I
 
- 
maxXprivate int maxX- Mappings:
- Namespace - Name - Mixin selector - official - f- Ldrs;f:I- intermediary - field_14377- Lnet/minecraft/class_3341;field_14377:I- named - maxX- Lnet/minecraft/util/math/BlockBox;maxX:I
 
- 
maxYprivate int maxY- Mappings:
- Namespace - Name - Mixin selector - official - g- Ldrs;g:I- intermediary - field_14376- Lnet/minecraft/class_3341;field_14376:I- named - maxY- Lnet/minecraft/util/math/BlockBox;maxY:I
 
- 
maxZprivate int maxZ- Mappings:
- Namespace - Name - Mixin selector - official - h- Ldrs;h:I- intermediary - field_14381- Lnet/minecraft/class_3341;field_14381:I- named - maxZ- Lnet/minecraft/util/math/BlockBox;maxZ:I
 
 
- 
- 
Constructor Details- 
BlockBoxCreates a box enclosing onlypos.- Mappings:
- Namespace - Name - Mixin selector - official - <init>- Ldrs;<init>(Lgu;)V- intermediary - <init>- Lnet/minecraft/class_3341;<init>(Lnet/minecraft/class_2338;)V- named - <init>- Lnet/minecraft/util/math/BlockBox;<init>(Lnet/minecraft/util/math/BlockPos;)V
 
- 
BlockBoxpublic BlockBox(int minX, int minY, int minZ, int maxX, int maxY, int maxZ) - Mappings:
- Namespace - Name - Mixin selector - official - <init>- Ldrs;<init>(IIIIII)V- intermediary - <init>- Lnet/minecraft/class_3341;<init>(IIIIII)V- named - <init>- Lnet/minecraft/util/math/BlockBox;<init>(IIIIII)V
 
 
- 
- 
Method Details- 
createReturns a new box from two corners,firstandsecond.- Returns:
- a new box from two corners, firstandsecond
- Mappings:
- Namespace - Name - Mixin selector - official - a- Ldrs;a(Lhz;Lhz;)Ldrs;- intermediary - method_34390- Lnet/minecraft/class_3341;method_34390(Lnet/minecraft/class_2382;Lnet/minecraft/class_2382;)Lnet/minecraft/class_3341;- named - create- Lnet/minecraft/util/math/BlockBox;create(Lnet/minecraft/util/math/Vec3i;Lnet/minecraft/util/math/Vec3i;)Lnet/minecraft/util/math/BlockBox;
 
- 
infiniteReturns a new all-encompassing, infinite box.- Returns:
- a new all-encompassing, infinite box
- Mappings:
- Namespace - Name - Mixin selector - official - a- Ldrs;a()Ldrs;- intermediary - method_14665- Lnet/minecraft/class_3341;method_14665()Lnet/minecraft/class_3341;- named - infinite- Lnet/minecraft/util/math/BlockBox;infinite()Lnet/minecraft/util/math/BlockBox;
 
- 
rotatedpublic static BlockBox rotated(int x, int y, int z, int offsetX, int offsetY, int offsetZ, int sizeX, int sizeY, int sizeZ, Direction facing) - Mappings:
- Namespace - Name - Mixin selector - official - a- Ldrs;a(IIIIIIIIILha;)Ldrs;- intermediary - method_14667- Lnet/minecraft/class_3341;method_14667(IIIIIIIIILnet/minecraft/class_2350;)Lnet/minecraft/class_3341;- named - rotated- Lnet/minecraft/util/math/BlockBox;rotated(IIIIIIIIILnet/minecraft/util/math/Direction;)Lnet/minecraft/util/math/BlockBox;
 
- 
intersectsReturns whetherotherintersects with this box.- Returns:
- whether otherintersects with this box
- Mappings:
- Namespace - Name - Mixin selector - official - a- Ldrs;a(Ldrs;)Z- intermediary - method_14657- Lnet/minecraft/class_3341;method_14657(Lnet/minecraft/class_3341;)Z- named - intersects- Lnet/minecraft/util/math/BlockBox;intersects(Lnet/minecraft/util/math/BlockBox;)Z
 
- 
intersectsXZpublic boolean intersectsXZ(int minX, int minZ, int maxX, int maxZ) Returns whether the rectangle from the given coordinates intersects with this box's XZ plane.- Returns:
- whether the rectangle from the given coordinates intersects with this box's XZ plane
- Mappings:
- Namespace - Name - Mixin selector - official - a- Ldrs;a(IIII)Z- intermediary - method_14669- Lnet/minecraft/class_3341;method_14669(IIII)Z- named - intersectsXZ- Lnet/minecraft/util/math/BlockBox;intersectsXZ(IIII)Z
 
- 
encompassPositionsReturns the minimum box encompassing all of the givenpositions, or an empty optional ifpositionsis empty.- Returns:
- the minimum box encompassing all of the given positions, or an empty optional ifpositionsis empty
- Mappings:
- Namespace - Name - Mixin selector - official - a- Ldrs;a(Ljava/lang/Iterable;)Ljava/util/Optional;- intermediary - method_35411- Lnet/minecraft/class_3341;method_35411(Ljava/lang/Iterable;)Ljava/util/Optional;- named - encompassPositions- Lnet/minecraft/util/math/BlockBox;encompassPositions(Ljava/lang/Iterable;)Ljava/util/Optional;
 
- 
encompassReturns the minimum box encompassing all of the givenboxes, or an empty optional ifboxesis empty.- Returns:
- the minimum box encompassing all of the given boxes, or an empty optional ifboxesis empty
- Mappings:
- Namespace - Name - Mixin selector - official - b- Ldrs;b(Ljava/lang/Iterable;)Ljava/util/Optional;- intermediary - method_35413- Lnet/minecraft/class_3341;method_35413(Ljava/lang/Iterable;)Ljava/util/Optional;- named - encompass- Lnet/minecraft/util/math/BlockBox;encompass(Ljava/lang/Iterable;)Ljava/util/Optional;
 
- 
encompassDeprecated.- Mappings:
- Namespace - Name - Mixin selector - official - b- Ldrs;b(Ldrs;)Ldrs;- intermediary - method_35412- Lnet/minecraft/class_3341;method_35412(Lnet/minecraft/class_3341;)Lnet/minecraft/class_3341;- named - encompass- Lnet/minecraft/util/math/BlockBox;encompass(Lnet/minecraft/util/math/BlockBox;)Lnet/minecraft/util/math/BlockBox;
 
- 
encompassDeprecated.Expands this box to encompass thepos.- Parameters:
- pos- the pos to encompass
- Returns:
- this box, for chaining
- Mappings:
- Namespace - Name - Mixin selector - official - a- Ldrs;a(Lgu;)Ldrs;- intermediary - method_34389- Lnet/minecraft/class_3341;method_34389(Lnet/minecraft/class_2338;)Lnet/minecraft/class_3341;- named - encompass- Lnet/minecraft/util/math/BlockBox;encompass(Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/util/math/BlockBox;
 
- 
moveDeprecated.- Mappings:
- Namespace - Name - Mixin selector - official - a- Ldrs;a(III)Ldrs;- intermediary - method_14661- Lnet/minecraft/class_3341;method_14661(III)Lnet/minecraft/class_3341;- named - move- Lnet/minecraft/util/math/BlockBox;move(III)Lnet/minecraft/util/math/BlockBox;
 
- 
moveDeprecated.- Mappings:
- Namespace - Name - Mixin selector - official - a- Ldrs;a(Lhz;)Ldrs;- intermediary - method_29299- Lnet/minecraft/class_3341;method_29299(Lnet/minecraft/class_2382;)Lnet/minecraft/class_3341;- named - move- Lnet/minecraft/util/math/BlockBox;move(Lnet/minecraft/util/math/Vec3i;)Lnet/minecraft/util/math/BlockBox;
 
- 
offsetReturns a new box that is translated byx,y,zon each axis from this box.- Returns:
- a new box that is translated by x,y,zon each axis from this box
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - b- Ldrs;b(III)Ldrs;- intermediary - method_19311- Lnet/minecraft/class_3341;method_19311(III)Lnet/minecraft/class_3341;- named - offset- Lnet/minecraft/util/math/BlockBox;offset(III)Lnet/minecraft/util/math/BlockBox;
 
- 
expandReturns a new box that is expanded on each direction byoffset.- Returns:
- a new box that is expanded on each direction by offset
- Mappings:
- Namespace - Name - Mixin selector - official - a- Ldrs;a(I)Ldrs;- intermediary - method_35410- Lnet/minecraft/class_3341;method_35410(I)Lnet/minecraft/class_3341;- named - expand- Lnet/minecraft/util/math/BlockBox;expand(I)Lnet/minecraft/util/math/BlockBox;
 
- 
containsReturns whether this box containspos.- Returns:
- whether this box contains pos
- Mappings:
- Namespace - Name - Mixin selector - official - b- Ldrs;b(Lhz;)Z- intermediary - method_14662- Lnet/minecraft/class_3341;method_14662(Lnet/minecraft/class_2382;)Z- named - contains- Lnet/minecraft/util/math/BlockBox;contains(Lnet/minecraft/util/math/Vec3i;)Z
 
- 
containspublic boolean contains(int x, int y, int z) - Mappings:
- Namespace - Name - Mixin selector - official - c- Ldrs;c(III)Z- intermediary - method_47593- Lnet/minecraft/class_3341;method_47593(III)Z- named - contains- Lnet/minecraft/util/math/BlockBox;contains(III)Z
 
- 
getDimensionsReturns the dimensions (the size) of this box.- Returns:
- the dimensions (the size) of this box
- Mappings:
- Namespace - Name - Mixin selector - official - b- Ldrs;b()Lhz;- intermediary - method_14659- Lnet/minecraft/class_3341;method_14659()Lnet/minecraft/class_2382;- named - getDimensions- Lnet/minecraft/util/math/BlockBox;getDimensions()Lnet/minecraft/util/math/Vec3i;
 
- 
getBlockCountXpublic int getBlockCountX()Returns the number of blocks on the X axis.This is equal to maxX - minX + 1.- Returns:
- the number of blocks on the X axis
- Mappings:
- Namespace - Name - Mixin selector - official - c- Ldrs;c()I- intermediary - method_35414- Lnet/minecraft/class_3341;method_35414()I- named - getBlockCountX- Lnet/minecraft/util/math/BlockBox;getBlockCountX()I
 
- 
getBlockCountYpublic int getBlockCountY()Returns the number of blocks on the Y axis.This is equal to maxY - minY + 1.- Returns:
- the number of blocks on the Y axis
- Mappings:
- Namespace - Name - Mixin selector - official - d- Ldrs;d()I- intermediary - method_14660- Lnet/minecraft/class_3341;method_14660()I- named - getBlockCountY- Lnet/minecraft/util/math/BlockBox;getBlockCountY()I
 
- 
getBlockCountZpublic int getBlockCountZ()Returns the number of blocks on the Z axis.This is equal to maxZ - minZ + 1.- Returns:
- the number of blocks on the Z axis
- Mappings:
- Namespace - Name - Mixin selector - official - e- Ldrs;e()I- intermediary - method_14663- Lnet/minecraft/class_3341;method_14663()I- named - getBlockCountZ- Lnet/minecraft/util/math/BlockBox;getBlockCountZ()I
 
- 
getCenterReturns the center of this box.- Returns:
- the center of this box
- API Note:
- This is biased toward the minimum bound corner of the box.
- Mappings:
- Namespace - Name - Mixin selector - official - f- Ldrs;f()Lgu;- intermediary - method_22874- Lnet/minecraft/class_3341;method_22874()Lnet/minecraft/class_2338;- named - getCenter- Lnet/minecraft/util/math/BlockBox;getCenter()Lnet/minecraft/util/math/BlockPos;
 
- 
forEachVertexCallsconsumerfor each vertex (corner) of this box.- Mappings:
- Namespace - Name - Mixin selector - official - a- Ldrs;a(Ljava/util/function/Consumer;)V- intermediary - method_34391- Lnet/minecraft/class_3341;method_34391(Ljava/util/function/Consumer;)V- named - forEachVertex- Lnet/minecraft/util/math/BlockBox;forEachVertex(Ljava/util/function/Consumer;)V
 
- 
toString
- 
equals
- 
hashCodepublic int hashCode()
- 
getMinXpublic int getMinX()- Mappings:
- Namespace - Name - Mixin selector - official - g- Ldrs;g()I- intermediary - method_35415- Lnet/minecraft/class_3341;method_35415()I- named - getMinX- Lnet/minecraft/util/math/BlockBox;getMinX()I
 
- 
getMinYpublic int getMinY()- Mappings:
- Namespace - Name - Mixin selector - official - h- Ldrs;h()I- intermediary - method_35416- Lnet/minecraft/class_3341;method_35416()I- named - getMinY- Lnet/minecraft/util/math/BlockBox;getMinY()I
 
- 
getMinZpublic int getMinZ()- Mappings:
- Namespace - Name - Mixin selector - official - i- Ldrs;i()I- intermediary - method_35417- Lnet/minecraft/class_3341;method_35417()I- named - getMinZ- Lnet/minecraft/util/math/BlockBox;getMinZ()I
 
- 
getMaxXpublic int getMaxX()- Mappings:
- Namespace - Name - Mixin selector - official - j- Ldrs;j()I- intermediary - method_35418- Lnet/minecraft/class_3341;method_35418()I- named - getMaxX- Lnet/minecraft/util/math/BlockBox;getMaxX()I
 
- 
getMaxYpublic int getMaxY()- Mappings:
- Namespace - Name - Mixin selector - official - k- Ldrs;k()I- intermediary - method_35419- Lnet/minecraft/class_3341;method_35419()I- named - getMaxY- Lnet/minecraft/util/math/BlockBox;getMaxY()I
 
- 
getMaxZpublic int getMaxZ()- Mappings:
- Namespace - Name - Mixin selector - official - l- Ldrs;l()I- intermediary - method_35420- Lnet/minecraft/class_3341;method_35420()I- named - getMaxZ- Lnet/minecraft/util/math/BlockBox;getMaxZ()I
 
 
-