Record Class WrappedMinMaxBounds
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.WrappedMinMaxBounds
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final WrappedMinMaxBounds
static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType
private final Float
The field for themax
record component.private final Float
The field for themin
record component. -
Constructor Summary
ConstructorsConstructorDescriptionWrappedMinMaxBounds
(Float min, Float max) Creates an instance of aWrappedMinMaxBounds
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic WrappedMinMaxBounds
atLeast
(float min) static WrappedMinMaxBounds
atMost
(float max) static WrappedMinMaxBounds
between
(float min, float max) final boolean
Indicates whether some other object is "equal to" this one.static WrappedMinMaxBounds
exactly
(float value) static WrappedMinMaxBounds
fromJson
(com.google.gson.JsonElement json) static WrappedMinMaxBounds
fromReader
(com.mojang.brigadier.StringReader reader, boolean isFloatingPoint) static WrappedMinMaxBounds
fromReader
(com.mojang.brigadier.StringReader reader, boolean isFloatingPoint, Function<Float, Float> valueFactory) final int
hashCode()
Returns a hash code value for this object.private static boolean
isAllowedNumber
(com.mojang.brigadier.StringReader reader, boolean isFloatingPoint) boolean
matches
(float value) boolean
matchesSqr
(double value) max()
Returns the value of themax
record component.min()
Returns the value of themin
record component.private static Float
optionallyFormat
(Float value, Function<Float, Float> valueFactory) private static Float
readNumber
(com.mojang.brigadier.StringReader reader, boolean isFloatingPoint) com.google.gson.JsonElement
final String
toString()
Returns a string representation of this record class.
-
Field Details
-
min
The field for themin
record component. -
max
The field for themax
record component. -
ANY
-
ERROR_INTS_ONLY
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_INTS_ONLY
-
-
Constructor Details
-
WrappedMinMaxBounds
Creates an instance of aWrappedMinMaxBounds
record class.- Parameters:
min
- the value for themin
record componentmax
- the value for themax
record component
-
-
Method Details
-
exactly
-
between
-
atLeast
-
atMost
-
matches
public boolean matches(float value) -
matchesSqr
public boolean matchesSqr(double value) -
serializeToJson
public com.google.gson.JsonElement serializeToJson() -
fromJson
-
fromReader
public static WrappedMinMaxBounds fromReader(com.mojang.brigadier.StringReader reader, boolean isFloatingPoint) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
fromReader
public static WrappedMinMaxBounds fromReader(com.mojang.brigadier.StringReader reader, boolean isFloatingPoint, Function<Float, Float> valueFactory) throws com.mojang.brigadier.exceptions.CommandSyntaxException- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
readNumber
@Nullable private static Float readNumber(com.mojang.brigadier.StringReader reader, boolean isFloatingPoint) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
isAllowedNumber
private static boolean isAllowedNumber(com.mojang.brigadier.StringReader reader, boolean isFloatingPoint) -
optionallyFormat
-
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 withObjects::equals(Object,Object)
. -
min
Returns the value of themin
record component.- Returns:
- the value of the
min
record component
-
max
Returns the value of themax
record component.- Returns:
- the value of the
max
record component
-