Record Class WrappedMinMaxBounds
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.WrappedMinMaxBounds
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final WrappedMinMaxBoundsstatic final com.mojang.brigadier.exceptions.SimpleCommandExceptionTypeprivate final FloatThe field for themaxrecord component.private final FloatThe field for theminrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionWrappedMinMaxBounds(Float min, Float max) Creates an instance of aWrappedMinMaxBoundsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic WrappedMinMaxBoundsatLeast(float pMin) static WrappedMinMaxBoundsatMost(float pMax) static WrappedMinMaxBoundsbetween(float pMin, float pMax) final booleanIndicates whether some other object is "equal to" this one.static WrappedMinMaxBoundsexactly(float pValue) static WrappedMinMaxBoundsfromJson(JsonElement pJson) static WrappedMinMaxBoundsfromReader(com.mojang.brigadier.StringReader pReader, boolean pIsFloatingPoint) static WrappedMinMaxBoundsfromReader(com.mojang.brigadier.StringReader pReader, boolean pIsFloatingPoint, Function<Float, Float> pValueFactory) final inthashCode()Returns a hash code value for this object.private static booleanisAllowedNumber(com.mojang.brigadier.StringReader pReader, boolean pIsFloatingPoint) booleanmatches(float pValue) booleanmatchesSqr(double pValue) max()Returns the value of themaxrecord component.min()Returns the value of theminrecord component.private static FloatoptionallyFormat(Float pValue, Function<Float, Float> pValueFactory) private static FloatreadNumber(com.mojang.brigadier.StringReader pReader, boolean pIsFloatingPoint) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
min
The field for theminrecord component. -
max
The field for themaxrecord component. -
ANY
-
ERROR_INTS_ONLY
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_INTS_ONLY
-
-
Constructor Details
-
WrappedMinMaxBounds
Creates an instance of aWrappedMinMaxBoundsrecord class.- Parameters:
min- the value for theminrecord componentmax- the value for themaxrecord component
-
-
Method Details
-
exactly
-
between
-
atLeast
-
atMost
-
matches
public boolean matches(float pValue) -
matchesSqr
public boolean matchesSqr(double pValue) -
serializeToJson
-
fromJson
-
fromReader
public static WrappedMinMaxBounds fromReader(com.mojang.brigadier.StringReader pReader, boolean pIsFloatingPoint) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
fromReader
public static WrappedMinMaxBounds fromReader(com.mojang.brigadier.StringReader pReader, boolean pIsFloatingPoint, Function<Float, Float> pValueFactory) throws com.mojang.brigadier.exceptions.CommandSyntaxException- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
readNumber
@Nullable private static Float readNumber(com.mojang.brigadier.StringReader pReader, boolean pIsFloatingPoint) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
isAllowedNumber
private static boolean isAllowedNumber(com.mojang.brigadier.StringReader pReader, boolean pIsFloatingPoint) -
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 theminrecord component.- Returns:
- the value of the
minrecord component
-
max
Returns the value of themaxrecord component.- Returns:
- the value of the
maxrecord component
-