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 original) final inthashCode()Returns a hash code value for this object.booleanstatic booleanisRelative(com.mojang.brigadier.StringReader reader) static WorldCoordinateparseDouble(com.mojang.brigadier.StringReader reader, boolean center) static WorldCoordinateparseInt(com.mojang.brigadier.StringReader reader) 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 original) -
parseDouble
public static WorldCoordinate parseDouble(com.mojang.brigadier.StringReader reader, boolean center) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
parseInt
public static WorldCoordinate parseInt(com.mojang.brigadier.StringReader reader) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
isRelative
public static boolean isRelative(com.mojang.brigadier.StringReader reader) -
isRelative
public boolean isRelative() -
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. -
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
-