Record Class DispatcherProvider.Case<Value extends Validatable>
java.lang.Object
java.lang.Record
net.minecraft.world.level.storage.loot.providers.number.DispatcherProvider.Case<Value>
- All Implemented Interfaces:
Validatable
- Enclosing interface:
DispatcherProvider<Value extends Validatable>
public static record DispatcherProvider.Case<Value extends Validatable>(Holder<LootItemCondition> condition, Holder<Value extends Validatable> value)
extends Record
implements Validatable
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCase(Holder<LootItemCondition> condition, Holder<Value> value) Creates an instance of aCaserecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <Value extends Validatable>
com.mojang.serialization.Codec<DispatcherProvider.Case<Value>> Returns the value of theconditionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleantest(LootContext context) final StringtoString()Returns a string representation of this record class.voidvalidate(ValidationContext context) value()Returns the value of thevaluerecord component.
-
Field Details
-
condition
The field for theconditionrecord component. -
value
The field for thevaluerecord component.
-
-
Constructor Details
-
Case
Creates an instance of aCaserecord class.- Parameters:
condition- the value for theconditionrecord componentvalue- the value for thevaluerecord component
-
-
Method Details
-
codec
public static <Value extends Validatable> com.mojang.serialization.Codec<DispatcherProvider.Case<Value>> codec(com.mojang.serialization.Codec<Holder<Value>> valueCodec) -
test
-
validate
- Specified by:
validatein interfaceValidatable
-
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). -
condition
Returns the value of theconditionrecord component.- Returns:
- the value of the
conditionrecord component
-
value
-