Record Class BlockPos
java.lang.Object
java.lang.Record
com.zenith.mc.block.BlockPos
- All Implemented Interfaces:
Comparable<BlockPos>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabove()above(int n) add(int x, int y, int z) addX(int delta) addY(int delta) addZ(int delta) longasLong()static longasLong(int x, int y, int z) below()below(int n) static intcompare(int x1, int y1, int z1, int x2, int y2, int z2) intorg.cloudburstmc.math.vector.Vector3idirectionTo(BlockPos other) doubleeast()east(int n) final booleanIndicates whether some other object is "equal to" this one.static BlockPosfromLong(long l) intintintstatic intgetX(long packedPos) static intgetY(long packedPos) static intgetZ(long packedPos) inthashCode()Returns a hash code value for this object.static longlongHash(int x, int y, int z) static longnorth()north(int n) offset(int x, int y, int z) south()south(int n) doublesquaredDistance(double x, double y, double z) doublesquaredDistance(BlockPos other) toString()Returns a string representation of this record class.west()west(int n) intx()Returns the value of thexrecord component.inty()Returns the value of theyrecord component.intz()Returns the value of thezrecord component.
-
Field Details
-
ZERO
-
PACKED_Y_LENGTH
public static final int PACKED_Y_LENGTH
-
-
Constructor Details
-
BlockPos
public BlockPos(double d, double e, double f) -
BlockPos
-
BlockPos
public BlockPos(int x, int y, int z) Creates an instance of aBlockPosrecord class.- Parameters:
x- the value for thexrecord componenty- the value for theyrecord componentz- the value for thezrecord component
-
-
Method Details
-
getChunkX
public int getChunkX() -
getChunkY
public int getChunkY() -
getChunkZ
public int getChunkZ() -
addX
-
add
-
addY
-
addZ
-
minus
-
north
-
north
-
south
-
south
-
east
-
east
-
west
-
west
-
above
-
above
-
below
-
below
-
relative
-
offset
-
subtract
-
relative
-
distance
-
squaredDistance
-
squaredDistance
public double squaredDistance(double x, double y, double z) -
directionTo
-
asLong
public long asLong() -
asLong
public static long asLong(int x, int y, int z) -
getX
public static int getX(long packedPos) -
getY
public static int getY(long packedPos) -
getZ
public static int getZ(long packedPos) -
compare
public static int compare(int x1, int y1, int z1, int x2, int y2, int z2) -
fromLong
-
compareTo
- Specified by:
compareToin interfaceComparable<BlockPos>
-
hashCode
-
toString
-
longHash
-
longHash
public static long longHash(int x, int y, int z) -
cross
-
offset
-
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. -
x
public int x()Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
y
public int y()Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-
z
public int z()Returns the value of thezrecord component.- Returns:
- the value of the
zrecord component
-