Record Class BlockVec
java.lang.Object
java.lang.Record
net.minestom.server.coordinate.BlockVec
- All Implemented Interfaces:
Point
Represents an immutable block position.
Usage note: If you accept a block position as an argument to a method, it's usually better to accept a Point rather than a BlockVec to avoid callers continually having to convert.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabs()add(double value) add(double x, double y, double z) add(int value) add(int x, int y, int z) intblockX()Returns the value of theblockXrecord component.intblockY()Returns the value of theblockYrecord component.intblockZ()Returns the value of theblockZrecord component.div(double value) div(double x, double y, double z) div(int value) div(int x, int y, int z) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.max(int value) max(int x, int y, int z) min(int value) min(int x, int y, int z) mul(double value) mul(double x, double y, double z) mul(int value) mul(int x, int y, int z) neg()booleansamePoint(int x, int y, int z) booleansub(double value) sub(double x, double y, double z) sub(int value) sub(int x, int y, int z) final StringtoString()Returns a string representation of this record class.withBlockX(int x) withBlockY(int y) withBlockZ(int z) withX(double x) Creates a point with the specified X coordinate.withX(DoubleUnaryOperator operator) Creates a point with a modified X coordinate based on its value.withY(double y) Creates a point with the specified Y coordinate.withY(DoubleUnaryOperator operator) Creates a point with a modified Y coordinate based on its value.withZ(double z) Creates a point with the specified Z coordinate.withZ(DoubleUnaryOperator operator) Creates a point with a modified Z coordinate based on its value.doublex()Gets the X coordinate.doubley()Gets the Y coordinate.doublez()Gets the Z coordinate.
-
Field Details
-
ZERO
-
ONE
-
SECTION
-
-
Constructor Details
-
BlockVec
public BlockVec(double x, double y, double z) -
BlockVec
-
BlockVec
public BlockVec(int value) -
BlockVec
public BlockVec(double value) -
BlockVec
public BlockVec(int blockX, int blockY, int blockZ) Creates an instance of aBlockVecrecord class.- Parameters:
blockX- the value for theblockXrecord componentblockY- the value for theblockYrecord componentblockZ- the value for theblockZrecord component
-
-
Method Details
-
x
-
y
-
z
-
withX
Description copied from interface:PointCreates a point with a modified X coordinate based on its value. -
withX
-
withBlockX
-
withY
Description copied from interface:PointCreates a point with a modified Y coordinate based on its value. -
withY
-
withBlockY
-
withZ
Description copied from interface:PointCreates a point with a modified Z coordinate based on its value. -
withZ
-
withBlockZ
-
add
-
add
-
add
-
add
-
add
-
add
-
sub
-
sub
-
sub
-
sub
-
sub
-
sub
-
mul
-
mul
-
mul
-
mul
-
mul
-
mul
-
div
-
div
-
div
-
div
-
div
-
div
-
relative
-
neg
-
abs
-
min
-
min
-
min
-
min
-
max
-
max
-
max
-
max
-
samePoint
-
samePoint
-
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. -
blockX
-
blockY
-
blockZ
-