Record Class LocalCoordinates
java.lang.Object
java.lang.Record
net.minecraft.commands.arguments.coordinates.LocalCoordinates
- All Implemented Interfaces:
Coordinates
public record LocalCoordinates(double left, double up, double forwards)
extends Record
implements Coordinates
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final doubleThe field for theforwardsrecord component.private final doubleThe field for theleftrecord component.static final charprivate final doubleThe field for theuprecord component. -
Constructor Summary
ConstructorsConstructorDescriptionLocalCoordinates(double left, double up, double forwards) Creates an instance of aLocalCoordinatesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.doubleforwards()Returns the value of theforwardsrecord component.getPosition(CommandSourceStack pSource) getRotation(CommandSourceStack pSource) final inthashCode()Returns a hash code value for this object.booleanbooleanbooleandoubleleft()Returns the value of theleftrecord component.static LocalCoordinatesparse(com.mojang.brigadier.StringReader pReader) private static doublereadDouble(com.mojang.brigadier.StringReader pReader, int pStart) final StringtoString()Returns a string representation of this record class.doubleup()Returns the value of theuprecord 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
-
left
private final double leftThe field for theleftrecord component. -
up
private final double upThe field for theuprecord component. -
forwards
private final double forwardsThe field for theforwardsrecord component. -
PREFIX_LOCAL_COORDINATE
public static final char PREFIX_LOCAL_COORDINATE- See Also:
-
-
Constructor Details
-
LocalCoordinates
public LocalCoordinates(double left, double up, double forwards) Creates an instance of aLocalCoordinatesrecord class.- Parameters:
left- the value for theleftrecord componentup- the value for theuprecord componentforwards- the value for theforwardsrecord 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
-
parse
public static LocalCoordinates parse(com.mojang.brigadier.StringReader pReader) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
readDouble
private static double readDouble(com.mojang.brigadier.StringReader pReader, int pStart) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
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 with '=='. -
left
public double left()Returns the value of theleftrecord component.- Returns:
- the value of the
leftrecord component
-
up
public double up()Returns the value of theuprecord component.- Returns:
- the value of the
uprecord component
-
forwards
public double forwards()Returns the value of theforwardsrecord component.- Returns:
- the value of the
forwardsrecord component
-