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 sender) getRotation(CommandSourceStack sender) final inthashCode()Returns a hash code value for this object.booleanbooleanbooleandoubleleft()Returns the value of theleftrecord component.static LocalCoordinatesparse(com.mojang.brigadier.StringReader reader) private static doublereadDouble(com.mojang.brigadier.StringReader reader, int start) final StringtoString()Returns a string representation of this record class.doubleup()Returns the value of theuprecord component.Methods inherited from interface 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 reader) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
readDouble
private static double readDouble(com.mojang.brigadier.StringReader reader, int start) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
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. -
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
-