Record Class Bounds
java.lang.Object
java.lang.Record
dev.despical.pixelpainter.core.Bounds
- Record Components:
minX- inclusive minimum XminY- inclusive minimum YminZ- inclusive minimum ZmaxX- inclusive maximum XmaxY- inclusive maximum YmaxZ- inclusive maximum Z
Describes an inclusive, axis-aligned block region in a separately identified world.
Both endpoints are part of the region. Overlap checks reserve journal regions, and chunk counting handles negative coordinates using arithmetic shifts.
-
Constructor Summary
ConstructorsConstructorDescriptionBounds(int minX, int minY, int minZ, int maxX, int maxY, int maxZ) Creates an instance of aBoundsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongchunks()Counts horizontal chunks touched by the inclusive X/Z span.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanintersects(Bounds other) Checks whether this region shares at least one block with another region.intmaxX()Returns the value of themaxXrecord component.intmaxY()Returns the value of themaxYrecord component.intmaxZ()Returns the value of themaxZrecord component.intminX()Returns the value of theminXrecord component.intminY()Returns the value of theminYrecord component.intminZ()Returns the value of theminZrecord component.static BoundsCreates normalized inclusive bounds from two opposite corners.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Bounds
public Bounds(int minX, int minY, int minZ, int maxX, int maxY, int maxZ) Creates an instance of aBoundsrecord class.
-
-
Method Details
-
of
-
intersects
Checks whether this region shares at least one block with another region.- Parameters:
other- region in the same world- Returns:
- whether all three inclusive axis spans overlap
-
chunks
public long chunks()Counts horizontal chunks touched by the inclusive X/Z span.- Returns:
- chunk count using wide arithmetic
-
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
minX
-
minY
-
minZ
-
maxX
-
maxY
-
maxZ
-