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 pX, double pY, double pZ) static WorldCoordinatesfinal booleanIndicates whether some other object is "equal to" this one.getPosition(CommandSourceStack pSource) getRotation(CommandSourceStack pSource) final inthashCode()Returns a hash code value for this object.booleanbooleanbooleanstatic WorldCoordinatesparseDouble(com.mojang.brigadier.StringReader pReader, boolean pCenterCorrect) static WorldCoordinatesparseInt(com.mojang.brigadier.StringReader pReader) 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 class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.commands.arguments.coordinates.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 pReader) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
parseDouble
public static WorldCoordinates parseDouble(com.mojang.brigadier.StringReader pReader, boolean pCenterCorrect) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
absolute
-
absolute
-
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. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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
-