Record Class InventoryChangeTrigger.TriggerInstance
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.InventoryChangeTrigger.TriggerInstance
- All Implemented Interfaces:
SimpleCriterionTrigger.SimpleInstance
,CriterionTriggerInstance
- Enclosing class:
InventoryChangeTrigger
public static record InventoryChangeTrigger.TriggerInstance(Optional<ContextAwarePredicate> player, InventoryChangeTrigger.TriggerInstance.Slots slots, List<ItemPredicate> items)
extends Record
implements SimpleCriterionTrigger.SimpleInstance
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<InventoryChangeTrigger.TriggerInstance> private final List
<ItemPredicate> The field for theitems
record component.private final Optional
<ContextAwarePredicate> The field for theplayer
record component.private final InventoryChangeTrigger.TriggerInstance.Slots
The field for theslots
record component. -
Constructor Summary
ConstructorDescriptionTriggerInstance
(Optional<ContextAwarePredicate> player, InventoryChangeTrigger.TriggerInstance.Slots slots, List<ItemPredicate> items) Creates an instance of aTriggerInstance
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.hasItems
(ItemPredicate... p_43198_) hasItems
(ItemPredicate.Builder... p_297239_) items()
Returns the value of theitems
record component.boolean
player()
Returns the value of theplayer
record component.slots()
Returns the value of theslots
record component.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.advancements.critereon.SimpleCriterionTrigger.SimpleInstance
validate
-
Field Details
-
player
The field for theplayer
record component. -
slots
The field for theslots
record component. -
items
The field for theitems
record component. -
CODEC
-
-
Constructor Details
-
TriggerInstance
public TriggerInstance(Optional<ContextAwarePredicate> player, InventoryChangeTrigger.TriggerInstance.Slots slots, List<ItemPredicate> items) Creates an instance of aTriggerInstance
record class.- Parameters:
player
- the value for theplayer
record componentslots
- the value for theslots
record componentitems
- the value for theitems
record component
-
-
Method Details
-
hasItems
public static Criterion<InventoryChangeTrigger.TriggerInstance> hasItems(ItemPredicate.Builder... p_297239_) -
hasItems
-
hasItems
-
matches
-
player
Returns the value of theplayer
record component.- Specified by:
player
in interfaceSimpleCriterionTrigger.SimpleInstance
- Returns:
- the value of the
player
record component
-
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)
. -
slots
Returns the value of theslots
record component.- Returns:
- the value of the
slots
record component
-
items
Returns the value of theitems
record component.- Returns:
- the value of the
items
record component
-