Record Class ElementalInfusionCriterion.Conditions
java.lang.Object
java.lang.Record
io.github.xrickastley.sevenelements.advancement.criterion.ElementalInfusionCriterion.Conditions
- All Implemented Interfaces:
AbstractCriterion.Conditions,CriterionConditions
- Enclosing class:
ElementalInfusionCriterion
public static record ElementalInfusionCriterion.Conditions(Optional<LootContextPredicate> player, Optional<ItemPredicate> item, Optional<Element> element)
extends Record
implements AbstractCriterion.Conditions
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ElementalInfusionCriterion.Conditions> The field for theelementrecord component.private final Optional<ItemPredicate> The field for theitemrecord component.private final Optional<LootContextPredicate> The field for theplayerrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionConditions(Optional<LootContextPredicate> player, Optional<ItemPredicate> item, Optional<Element> element) Creates an instance of aConditionsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionelement()Returns the value of theelementrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.item()Returns the value of theitemrecord component.player()Returns the value of theplayerrecord component.booleanrequirementsMet(ItemStack stack, Element infused) final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.advancement.criterion.AbstractCriterion.Conditions
validate
-
Field Details
-
player
The field for theplayerrecord component. -
item
The field for theitemrecord component. -
element
The field for theelementrecord component. -
CODEC
-
-
Constructor Details
-
Conditions
public Conditions(Optional<LootContextPredicate> player, Optional<ItemPredicate> item, Optional<Element> element) Creates an instance of aConditionsrecord class.- Parameters:
player- the value for theplayerrecord componentitem- the value for theitemrecord componentelement- the value for theelementrecord component
-
-
Method Details
-
requirementsMet
-
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). -
player
Returns the value of theplayerrecord component.- Specified by:
playerin interfaceAbstractCriterion.Conditions- Returns:
- the value of the
playerrecord component
-
item
Returns the value of theitemrecord component.- Returns:
- the value of the
itemrecord component
-
element
Returns the value of theelementrecord component.- Returns:
- the value of the
elementrecord component
-