Record Class BredAnimalsTrigger.TriggerInstance
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.BredAnimalsTrigger.TriggerInstance
- All Implemented Interfaces:
SimpleCriterionTrigger.SimpleInstance
,CriterionTriggerInstance
- Enclosing class:
- BredAnimalsTrigger
public static record BredAnimalsTrigger.TriggerInstance(Optional<ContextAwarePredicate> player, Optional<ContextAwarePredicate> parent, Optional<ContextAwarePredicate> partner, Optional<ContextAwarePredicate> child)
extends Record
implements SimpleCriterionTrigger.SimpleInstance
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Optional<ContextAwarePredicate>
The field for thechild
record component.static final com.mojang.serialization.Codec<BredAnimalsTrigger.TriggerInstance>
private final Optional<ContextAwarePredicate>
The field for theparent
record component.private final Optional<ContextAwarePredicate>
The field for thepartner
record component.private final Optional<ContextAwarePredicate>
The field for theplayer
record component. -
Constructor Summary
ConstructorDescriptionTriggerInstance
(Optional<ContextAwarePredicate> player, Optional<ContextAwarePredicate> parent, Optional<ContextAwarePredicate> partner, Optional<ContextAwarePredicate> child) Creates an instance of aTriggerInstance
record class. -
Method Summary
Modifier and TypeMethodDescriptionbredAnimals
(Optional<EntityPredicate> p_298213_, Optional<EntityPredicate> p_299258_, Optional<EntityPredicate> p_297439_) bredAnimals
(EntityPredicate.Builder p_18668_) child()
Returns the value of thechild
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.private static boolean
matches
(Optional<ContextAwarePredicate> p_300266_, LootContext p_300903_) boolean
matches
(LootContext p_18676_, LootContext p_18677_, LootContext p_18678_) parent()
Returns the value of theparent
record component.partner()
Returns the value of thepartner
record component.player()
Returns the value of theplayer
record component.final String
toString()
Returns a string representation of this record class.void
validate
(CriterionValidator p_312724_)
-
Field Details
-
player
The field for theplayer
record component. -
parent
The field for theparent
record component. -
partner
The field for thepartner
record component. -
child
The field for thechild
record component. -
CODEC
-
-
Constructor Details
-
TriggerInstance
public TriggerInstance(Optional<ContextAwarePredicate> player, Optional<ContextAwarePredicate> parent, Optional<ContextAwarePredicate> partner, Optional<ContextAwarePredicate> child) Creates an instance of aTriggerInstance
record class.- Parameters:
player
- the value for theplayer
record componentparent
- the value for theparent
record componentpartner
- the value for thepartner
record componentchild
- the value for thechild
record component
-
-
Method Details
-
bredAnimals
-
bredAnimals
public static Criterion<BredAnimalsTrigger.TriggerInstance> bredAnimals(EntityPredicate.Builder p_18668_) -
bredAnimals
public static Criterion<BredAnimalsTrigger.TriggerInstance> bredAnimals(Optional<EntityPredicate> p_298213_, Optional<EntityPredicate> p_299258_, Optional<EntityPredicate> p_297439_) -
matches
-
matches
-
validate
- Specified by:
validate
in interfaceCriterionTriggerInstance
- Specified by:
validate
in interfaceSimpleCriterionTrigger.SimpleInstance
-
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)
. -
parent
Returns the value of theparent
record component.- Returns:
- the value of the
parent
record component
-
partner
Returns the value of thepartner
record component.- Returns:
- the value of the
partner
record component
-
child
Returns the value of thechild
record component.- Returns:
- the value of the
child
record component
-