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

    Fields
    Modifier and Type
    Field
    Description
    private final double
    The field for the forwards record component.
    private final double
    The field for the left record component.
    static final char
     
    private final double
    The field for the up record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    LocalCoordinates(double left, double up, double forwards)
    Creates an instance of a LocalCoordinates record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    double
    Returns the value of the forwards record component.
     
     
    final int
    Returns a hash code value for this object.
    boolean
     
    boolean
     
    boolean
     
    double
    Returns the value of the left record component.
    parse(com.mojang.brigadier.StringReader pReader)
     
    private static double
    readDouble(com.mojang.brigadier.StringReader pReader, int pStart)
     
    final String
    Returns a string representation of this record class.
    double
    up()
    Returns the value of the up record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.minecraft.commands.arguments.coordinates.Coordinates

    getBlockPos
  • Field Details

    • left

      private final double left
      The field for the left record component.
    • up

      private final double up
      The field for the up record component.
    • forwards

      private final double forwards
      The field for the forwards record 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 a LocalCoordinates record class.
      Parameters:
      left - the value for the left record component
      up - the value for the up record component
      forwards - the value for the forwards record component
  • Method Details

    • getPosition

      public Vec3 getPosition(CommandSourceStack pSource)
      Specified by:
      getPosition in interface Coordinates
    • getRotation

      public Vec2 getRotation(CommandSourceStack pSource)
      Specified by:
      getRotation in interface Coordinates
    • isXRelative

      public boolean isXRelative()
      Specified by:
      isXRelative in interface Coordinates
    • isYRelative

      public boolean isYRelative()
      Specified by:
      isYRelative in interface Coordinates
    • isZRelative

      public boolean isZRelative()
      Specified by:
      isZRelative in interface Coordinates
    • 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

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • left

      public double left()
      Returns the value of the left record component.
      Returns:
      the value of the left record component
    • up

      public double up()
      Returns the value of the up record component.
      Returns:
      the value of the up record component
    • forwards

      public double forwards()
      Returns the value of the forwards record component.
      Returns:
      the value of the forwards record component