Record Class WorldCoordinates
java.lang.Object
java.lang.Record
net.minecraft.commands.arguments.coordinates.WorldCoordinates
- All Implemented Interfaces:
Coordinates
public record WorldCoordinates(WorldCoordinate x, WorldCoordinate y, WorldCoordinate z)
extends Record
implements Coordinates
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final WorldCoordinateThe field for thexrecord component.private final WorldCoordinateThe field for theyrecord component.private final WorldCoordinateThe field for thezrecord component.static final WorldCoordinates -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aWorldCoordinatesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic WorldCoordinatesabsolute(double x, double y, double z) static WorldCoordinatesfinal booleanIndicates whether some other object is "equal to" this one.getPosition(CommandSourceStack sender) getRotation(CommandSourceStack sender) final inthashCode()Returns a hash code value for this object.booleanbooleanbooleanstatic WorldCoordinatesparseDouble(com.mojang.brigadier.StringReader reader, boolean centerCorrect) static WorldCoordinatesparseInt(com.mojang.brigadier.StringReader reader) final StringtoString()Returns a string representation of this record class.x()Returns the value of thexrecord component.y()Returns the value of theyrecord component.z()Returns the value of thezrecord component.Methods inherited from interface Coordinates
getBlockPos
-
Field Details
-
x
The field for thexrecord component. -
y
The field for theyrecord component. -
z
The field for thezrecord component. -
ZERO_ROTATION
-
-
Constructor Details
-
WorldCoordinates
Creates an instance of aWorldCoordinatesrecord class.- Parameters:
x- the value for thexrecord componenty- the value for theyrecord componentz- the value for thezrecord component
-
-
Method Details
-
getPosition
- Specified by:
getPositionin interfaceCoordinates
-
getRotation
- Specified by:
getRotationin interfaceCoordinates
-
isXRelative
public boolean isXRelative()- Specified by:
isXRelativein interfaceCoordinates
-
isYRelative
public boolean isYRelative()- Specified by:
isYRelativein interfaceCoordinates
-
isZRelative
public boolean isZRelative()- Specified by:
isZRelativein interfaceCoordinates
-
parseInt
public static WorldCoordinates parseInt(com.mojang.brigadier.StringReader reader) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
parseDouble
public static WorldCoordinates parseDouble(com.mojang.brigadier.StringReader reader, boolean centerCorrect) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
absolute
-
absolute
-
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 withObjects::equals(Object,Object). -
x
Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
y
Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-
z
Returns the value of thezrecord component.- Returns:
- the value of the
zrecord component
-