Record Class WorldCoordinate
java.lang.Object
java.lang.Record
net.minecraft.commands.arguments.coordinates.WorldCoordinate
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.brigadier.exceptions.SimpleCommandExceptionTypestatic final com.mojang.brigadier.exceptions.SimpleCommandExceptionTypeprivate static final charprivate final booleanThe field for therelativerecord component.private final doubleThe field for thevaluerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionWorldCoordinate(boolean relative, double value) Creates an instance of aWorldCoordinaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.doubleget(double pCoord) final inthashCode()Returns a hash code value for this object.booleanstatic booleanisRelative(com.mojang.brigadier.StringReader pReader) static WorldCoordinateparseDouble(com.mojang.brigadier.StringReader pReader, boolean pCenterCorrect) static WorldCoordinateparseInt(com.mojang.brigadier.StringReader pReader) booleanrelative()Returns the value of therelativerecord component.final StringtoString()Returns a string representation of this record class.doublevalue()Returns the value of thevaluerecord component.
-
Field Details
-
relative
private final boolean relativeThe field for therelativerecord component. -
value
private final double valueThe field for thevaluerecord component. -
PREFIX_RELATIVE
private static final char PREFIX_RELATIVE- See Also:
-
ERROR_EXPECTED_DOUBLE
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_EXPECTED_DOUBLE -
ERROR_EXPECTED_INT
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_EXPECTED_INT
-
-
Constructor Details
-
WorldCoordinate
public WorldCoordinate(boolean relative, double value) Creates an instance of aWorldCoordinaterecord class.- Parameters:
relative- the value for therelativerecord componentvalue- the value for thevaluerecord component
-
-
Method Details
-
get
public double get(double pCoord) -
parseDouble
public static WorldCoordinate parseDouble(com.mojang.brigadier.StringReader pReader, boolean pCenterCorrect) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
parseInt
public static WorldCoordinate parseInt(com.mojang.brigadier.StringReader pReader) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
isRelative
public static boolean isRelative(com.mojang.brigadier.StringReader pReader) -
isRelative
public boolean isRelative() -
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 '=='. -
relative
public boolean relative()Returns the value of therelativerecord component.- Returns:
- the value of the
relativerecord component
-
value
public double value()Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-