Record Class FloatValueCheck
java.lang.Object
java.lang.Record
net.minecraft.world.level.storage.loot.predicates.FloatValueCheck
- All Implemented Interfaces:
Predicate<LootContext>, LootContextUser, LootItemCondition, Validatable
public record FloatValueCheck(Holder<ContextFloatProvider> value, FloatRangePredicate range)
extends Record
implements LootItemCondition
-
Nested Class Summary
Nested classes/interfaces inherited from interface LootItemCondition
LootItemCondition.Builder -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<FloatValueCheck> private final FloatRangePredicateThe field for therangerecord component.private final Holder<ContextFloatProvider> The field for thevaluerecord component.Fields inherited from interface LootItemCondition
CODEC, DIRECT_CODEC, LIST_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionFloatValueCheck(Holder<ContextFloatProvider> value, FloatRangePredicate range) Creates an instance of aFloatValueCheckrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<FloatValueCheck> codec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static LootItemCondition.BuilderhasValue(Holder<ContextFloatProvider> value, FloatRangePredicate range) range()Returns the value of therangerecord component.booleantest(LootContext context) final StringtoString()Returns a string representation of this record class.voidvalidate(ValidationContext context) value()Returns the value of thevaluerecord component.Methods inherited from interface LootContextUser
getReferencedContextParams
-
Field Details
-
value
The field for thevaluerecord component. -
range
The field for therangerecord component. -
MAP_CODEC
-
-
Constructor Details
-
FloatValueCheck
Creates an instance of aFloatValueCheckrecord class.- Parameters:
value- the value for thevaluerecord componentrange- the value for therangerecord component
-
-
Method Details
-
codec
- Specified by:
codecin interfaceLootItemCondition
-
validate
- Specified by:
validatein interfaceLootContextUser- Specified by:
validatein interfaceValidatable
-
test
- Specified by:
testin interfacePredicate<LootContext>
-
hasValue
public static LootItemCondition.Builder hasValue(Holder<ContextFloatProvider> value, FloatRangePredicate range) -
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 withObjects::equals(Object,Object). -
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
range
Returns the value of therangerecord component.- Returns:
- the value of the
rangerecord component
-