Package cn.nukkit.level.util
Record Class BlockIndex
java.lang.Object
java.lang.Record
cn.nukkit.level.util.BlockIndex
@PowerNukkitXOnly
@Since("1.6.0.0-PNX")
public record BlockIndex(int x, int y, int z, int layer, long hash)
extends Record
-
Constructor Summary
ConstructorDescriptionBlockIndex
(int x, int y, int z, int layer, long hash) Creates an instance of aBlockIndex
record class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether some other object is "equal to" this one.long
hash()
Returns the value of thehash
record component.int
hashCode()
Returns a hash code value for this object.int
layer()
Returns the value of thelayer
record component.static BlockIndex
of
(int x, int y, int z, int layer) final String
toString()
Returns a string representation of this record class.int
x()
Returns the value of thex
record component.int
y()
Returns the value of they
record component.int
z()
Returns the value of thez
record component.
-
Constructor Details
-
BlockIndex
public BlockIndex(int x, int y, int z, int layer, long hash) Creates an instance of aBlockIndex
record class.- Parameters:
x
- the value for thex
record componenty
- the value for they
record componentz
- the value for thez
record componentlayer
- the value for thelayer
record componenthash
- the value for thehash
record component
-
-
Method Details
-
of
-
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 '=='. -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
x
public int x()Returns the value of thex
record component.- Returns:
- the value of the
x
record component
-
y
public int y()Returns the value of they
record component.- Returns:
- the value of the
y
record component
-
z
public int z()Returns the value of thez
record component.- Returns:
- the value of the
z
record component
-
layer
public int layer()Returns the value of thelayer
record component.- Returns:
- the value of the
layer
record component
-
hash
public long hash()Returns the value of thehash
record component.- Returns:
- the value of the
hash
record component
-