Record Class MazeBounds
- Record Components:
origin- the minimum corner and world identitywidth- the positive block count along Xheight- the positive block count along Ydepth- the positive block count along Z
The origin is the minimum block corner. Each dimension is a block count, so
the maximum X coordinate is origin.x() + width - 1; the same rule
applies to Y and Z. Maze bounds include the floor and any generated roof.
Construction validates positive dimensions, maximum-coordinate overflow, and a volume representable as a long. It does not require a loaded world or check the world border, build-height limits, or the server's maze-size limits.
-
Constructor Summary
ConstructorsConstructorDescriptionMazeBounds(MazeLocation origin, int width, int height, int depth) Constructs a block volume with representable coordinates and size. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(MazeLocation point) Tests whether a world block position lies inside this inclusive volume.intdepth()Returns the value of thedepthrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intheight()Returns the value of theheightrecord component.origin()Returns the value of theoriginrecord component.final StringtoString()Returns a string representation of this record class.longvolume()Returns the number of blocks contained in this volume.intwidth()Returns the value of thewidthrecord component.
-
Constructor Details
-
MazeBounds
Constructs a block volume with representable coordinates and size.All dimensions must be positive. Inclusive maximum coordinates are checked with exact arithmetic before the volume can be used for containment queries.
- Parameters:
origin- the minimum world block cornerwidth- the block count along Xheight- the block count along Ydepth- the block count along Z- Throws:
NullPointerException- iforiginis nullIllegalArgumentException- if any dimension is nonpositiveArithmeticException- if a maximum coordinate or the volume overflows
-
-
Method Details
-
volume
public long volume()Returns the number of blocks contained in this volume.This includes air positions as well as solid blocks. It is the full bounded volume, not the count of structure blocks in a generation plan.
- Returns:
- the product of width, height, and depth
-
contains
Tests whether a world block position lies inside this inclusive volume.The point must have the same world UUID and fall within all three coordinate ranges. A position on any minimum or maximum face is included.
- Parameters:
point- the world block position to test- Returns:
- true when the world and every coordinate are within the bounds
- Throws:
NullPointerException- ifpointis null
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
origin
-
width
-
height
-
depth
-