Record Class StatePropertiesPredicate.RangedMatcher
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.StatePropertiesPredicate.RangedMatcher
- All Implemented Interfaces:
StatePropertiesPredicate.ValueMatcher
- Enclosing class:
StatePropertiesPredicate
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<StatePropertiesPredicate.RangedMatcher> The field for themaxValue
record component.The field for theminValue
record component.static final StreamCodec
<io.netty.buffer.ByteBuf, StatePropertiesPredicate.RangedMatcher> -
Constructor Summary
ConstructorDescriptionRangedMatcher
(Optional<String> minValue, Optional<String> maxValue) Creates an instance of aRangedMatcher
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.<T extends Comparable<T>>
booleanmatch
(StateHolder<?, ?> p_299120_, Property<T> p_300783_) maxValue()
Returns the value of themaxValue
record component.minValue()
Returns the value of theminValue
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
minValue
The field for theminValue
record component. -
maxValue
The field for themaxValue
record component. -
CODEC
-
STREAM_CODEC
public static final StreamCodec<io.netty.buffer.ByteBuf,StatePropertiesPredicate.RangedMatcher> STREAM_CODEC
-
-
Constructor Details
-
RangedMatcher
Creates an instance of aRangedMatcher
record class.- Parameters:
minValue
- the value for theminValue
record componentmaxValue
- the value for themaxValue
record component
-
-
Method Details
-
match
- Specified by:
match
in interfaceStatePropertiesPredicate.ValueMatcher
-
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)
. -
minValue
Returns the value of theminValue
record component.- Returns:
- the value of the
minValue
record component
-
maxValue
Returns the value of themaxValue
record component.- Returns:
- the value of the
maxValue
record component
-