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- Mappings:
Namespace Name official cypintermediary net/minecraft/class_3341named net/minecraft/util/math/BlockBox
-
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 BlockBoxcreate(Vec3i first, Vec3i second)static BlockBoxempty()Creates an empty box.voidencompass(BlockBox region)BlockBoxencompass(BlockPos pos)Expands this box to encompass thepos.booleanequals(Object o)voidforEachVertex(Consumer<BlockPos> consumer)intgetBlockCountX()intgetBlockCountY()intgetBlockCountZ()BlockPosgetCenter()Vec3igetDimensions()inthashCode()static BlockBoxinfinite()booleanintersects(BlockBox other)booleanintersectsXZ(int minX, int minZ, int maxX, int maxZ)BlockBoxmove(int dx, int dy, int dz)BlockBoxmove(Vec3i vec)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)StringtoString()
-
Field Details
-
CODEC
A 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 aLcyp;a:Lcom/mojang/serialization/Codec;intermediary field_29325Lnet/minecraft/class_3341;field_29325:Lcom/mojang/serialization/Codec;named CODECLnet/minecraft/util/math/BlockBox;CODEC:Lcom/mojang/serialization/Codec;
-
minX
public int minX- Mappings:
Namespace Name Mixin selector official bLcyp;b:Iintermediary field_14381Lnet/minecraft/class_3341;field_14381:Inamed minXLnet/minecraft/util/math/BlockBox;minX:I
-
minY
public int minY- Mappings:
Namespace Name Mixin selector official cLcyp;c:Iintermediary field_14380Lnet/minecraft/class_3341;field_14380:Inamed minYLnet/minecraft/util/math/BlockBox;minY:I
-
minZ
public int minZ- Mappings:
Namespace Name Mixin selector official dLcyp;d:Iintermediary field_14379Lnet/minecraft/class_3341;field_14379:Inamed minZLnet/minecraft/util/math/BlockBox;minZ:I
-
maxX
public int maxX- Mappings:
Namespace Name Mixin selector official eLcyp;e:Iintermediary field_14378Lnet/minecraft/class_3341;field_14378:Inamed maxXLnet/minecraft/util/math/BlockBox;maxX:I
-
maxY
public int maxY- Mappings:
Namespace Name Mixin selector official fLcyp;f:Iintermediary field_14377Lnet/minecraft/class_3341;field_14377:Inamed maxYLnet/minecraft/util/math/BlockBox;maxY:I
-
maxZ
public int maxZ- Mappings:
Namespace Name Mixin selector official gLcyp;g:Iintermediary field_14376Lnet/minecraft/class_3341;field_14376:Inamed maxZLnet/minecraft/util/math/BlockBox;maxZ:I
-
-
Constructor Details
-
BlockBox
Creates a box enclosing onlypos.- Mappings:
Namespace Name Mixin selector official <init>Lcyp;<init>(Lfx;)Vintermediary <init>Lnet/minecraft/class_3341;<init>(Lnet/minecraft/class_2338;)Vnamed <init>Lnet/minecraft/util/math/BlockBox;<init>(Lnet/minecraft/util/math/BlockPos;)V
-
BlockBox
public BlockBox(int minX, int minY, int minZ, int maxX, int maxY, int maxZ)- Mappings:
Namespace Name Mixin selector official <init>Lcyp;<init>(IIIIII)Vintermediary <init>Lnet/minecraft/class_3341;<init>(IIIIII)Vnamed <init>Lnet/minecraft/util/math/BlockBox;<init>(IIIIII)V
-
-
Method Details
-
create
- Mappings:
Namespace Name Mixin selector official aLcyp;a(Lgs;Lgs;)Lcyp;intermediary method_34390Lnet/minecraft/class_3341;method_34390(Lnet/minecraft/class_2382;Lnet/minecraft/class_2382;)Lnet/minecraft/class_3341;named createLnet/minecraft/util/math/BlockBox;create(Lnet/minecraft/util/math/Vec3i;Lnet/minecraft/util/math/Vec3i;)Lnet/minecraft/util/math/BlockBox;
-
create
- Mappings:
Namespace Name Mixin selector official aLcyp;a(IIIIII)Lcyp;intermediary method_14666Lnet/minecraft/class_3341;method_14666(IIIIII)Lnet/minecraft/class_3341;named createLnet/minecraft/util/math/BlockBox;create(IIIIII)Lnet/minecraft/util/math/BlockBox;
-
empty
Creates an empty box.- Mappings:
Namespace Name Mixin selector official aLcyp;a()Lcyp;intermediary method_14665Lnet/minecraft/class_3341;method_14665()Lnet/minecraft/class_3341;named emptyLnet/minecraft/util/math/BlockBox;empty()Lnet/minecraft/util/math/BlockBox;
-
infinite
- Mappings:
Namespace Name Mixin selector official bLcyp;b()Lcyp;intermediary method_27234Lnet/minecraft/class_3341;method_27234()Lnet/minecraft/class_3341;named infiniteLnet/minecraft/util/math/BlockBox;infinite()Lnet/minecraft/util/math/BlockBox;
-
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)- Mappings:
Namespace Name Mixin selector official aLcyp;a(IIIIIIIIILgc;)Lcyp;intermediary method_14667Lnet/minecraft/class_3341;method_14667(IIIIIIIIILnet/minecraft/class_2350;)Lnet/minecraft/class_3341;named rotatedLnet/minecraft/util/math/BlockBox;rotated(IIIIIIIIILnet/minecraft/util/math/Direction;)Lnet/minecraft/util/math/BlockBox;
-
intersects
- Mappings:
Namespace Name Mixin selector official aLcyp;a(Lcyp;)Zintermediary method_14657Lnet/minecraft/class_3341;method_14657(Lnet/minecraft/class_3341;)Znamed intersectsLnet/minecraft/util/math/BlockBox;intersects(Lnet/minecraft/util/math/BlockBox;)Z
-
intersectsXZ
public boolean intersectsXZ(int minX, int minZ, int maxX, int maxZ)- Mappings:
Namespace Name Mixin selector official aLcyp;a(IIII)Zintermediary method_14669Lnet/minecraft/class_3341;method_14669(IIII)Znamed intersectsXZLnet/minecraft/util/math/BlockBox;intersectsXZ(IIII)Z
-
encompass
- Mappings:
Namespace Name Mixin selector official bLcyp;b(Lcyp;)Vintermediary method_14668Lnet/minecraft/class_3341;method_14668(Lnet/minecraft/class_3341;)Vnamed encompassLnet/minecraft/util/math/BlockBox;encompass(Lnet/minecraft/util/math/BlockBox;)V
-
encompass
Expands this box to encompass thepos.- Parameters:
pos- the pos to encompass- Returns:
- this box, for chaining
- Mappings:
Namespace Name Mixin selector official aLcyp;a(Lfx;)Lcyp;intermediary method_34389Lnet/minecraft/class_3341;method_34389(Lnet/minecraft/class_2338;)Lnet/minecraft/class_3341;named encompassLnet/minecraft/util/math/BlockBox;encompass(Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/util/math/BlockBox;
-
move
- Mappings:
Namespace Name Mixin selector official aLcyp;a(III)Lcyp;intermediary method_14661Lnet/minecraft/class_3341;method_14661(III)Lnet/minecraft/class_3341;named moveLnet/minecraft/util/math/BlockBox;move(III)Lnet/minecraft/util/math/BlockBox;
-
move
- Mappings:
Namespace Name Mixin selector official aLcyp;a(Lgs;)Lcyp;intermediary method_29299Lnet/minecraft/class_3341;method_29299(Lnet/minecraft/class_2382;)Lnet/minecraft/class_3341;named moveLnet/minecraft/util/math/BlockBox;move(Lnet/minecraft/util/math/Vec3i;)Lnet/minecraft/util/math/BlockBox;
-
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)- Mappings:
Namespace Name Mixin selector official bLcyp;b(III)Lcyp;intermediary method_19311Lnet/minecraft/class_3341;method_19311(III)Lnet/minecraft/class_3341;named offsetLnet/minecraft/util/math/BlockBox;offset(III)Lnet/minecraft/util/math/BlockBox;
-
contains
- Mappings:
Namespace Name Mixin selector official bLcyp;b(Lgs;)Zintermediary method_14662Lnet/minecraft/class_3341;method_14662(Lnet/minecraft/class_2382;)Znamed containsLnet/minecraft/util/math/BlockBox;contains(Lnet/minecraft/util/math/Vec3i;)Z
-
getDimensions
- Mappings:
Namespace Name Mixin selector official cLcyp;c()Lgs;intermediary method_14659Lnet/minecraft/class_3341;method_14659()Lnet/minecraft/class_2382;named getDimensionsLnet/minecraft/util/math/BlockBox;getDimensions()Lnet/minecraft/util/math/Vec3i;
-
getBlockCountX
public int getBlockCountX()- Mappings:
Namespace Name Mixin selector official dLcyp;d()Iintermediary method_14660Lnet/minecraft/class_3341;method_14660()Inamed getBlockCountXLnet/minecraft/util/math/BlockBox;getBlockCountX()I
-
getBlockCountY
public int getBlockCountY()- Mappings:
Namespace Name Mixin selector official eLcyp;e()Iintermediary method_14663Lnet/minecraft/class_3341;method_14663()Inamed getBlockCountYLnet/minecraft/util/math/BlockBox;getBlockCountY()I
-
getBlockCountZ
public int getBlockCountZ()- Mappings:
Namespace Name Mixin selector official fLcyp;f()Iintermediary method_14664Lnet/minecraft/class_3341;method_14664()Inamed getBlockCountZLnet/minecraft/util/math/BlockBox;getBlockCountZ()I
-
getCenter
- Implementation Note:
- Biased toward the minimum bound corner of the box.
- Mappings:
Namespace Name Mixin selector official gLcyp;g()Lfx;intermediary method_22874Lnet/minecraft/class_3341;method_22874()Lnet/minecraft/class_2338;named getCenterLnet/minecraft/util/math/BlockBox;getCenter()Lnet/minecraft/util/math/BlockPos;
-
forEachVertex
- Mappings:
Namespace Name Mixin selector official aLcyp;a(Ljava/util/function/Consumer;)Vintermediary method_34391Lnet/minecraft/class_3341;method_34391(Ljava/util/function/Consumer;)Vnamed forEachVertexLnet/minecraft/util/math/BlockBox;forEachVertex(Ljava/util/function/Consumer;)V
-
toString
-
equals
-
hashCode
public int hashCode()
-