Record Class CitizenEatFoodTrigger.CitizenEatFoodTriggerInstance
java.lang.Object
java.lang.Record
com.minecolonies.api.advancements.CitizenEatFoodTrigger.CitizenEatFoodTriggerInstance
- All Implemented Interfaces:
net.minecraft.advancements.critereon.SimpleCriterionTrigger.SimpleInstance,net.minecraft.advancements.CriterionTriggerInstance
- Enclosing class:
CitizenEatFoodTrigger
public static record CitizenEatFoodTrigger.CitizenEatFoodTriggerInstance(Optional<net.minecraft.advancements.critereon.ContextAwarePredicate> player, List<net.minecraft.advancements.critereon.ItemPredicate> itemPredicates)
extends Record
implements net.minecraft.advancements.critereon.SimpleCriterionTrigger.SimpleInstance
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<CitizenEatFoodTrigger.CitizenEatFoodTriggerInstance> static final List<net.minecraft.advancements.critereon.ItemPredicate> -
Constructor Summary
ConstructorsConstructorDescriptionCitizenEatFoodTriggerInstance(Optional<net.minecraft.advancements.critereon.ContextAwarePredicate> player, List<net.minecraft.advancements.critereon.ItemPredicate> itemPredicates) Creates an instance of aCitizenEatFoodTriggerInstancerecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.advancements.Criterion<CitizenEatFoodTrigger.CitizenEatFoodTriggerInstance> static net.minecraft.advancements.Criterion<CitizenEatFoodTrigger.CitizenEatFoodTriggerInstance> citizenEatFood(List<net.minecraft.advancements.critereon.ItemPredicate> itemPredicates) Construct the check with a single item conditionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.List<net.minecraft.advancements.critereon.ItemPredicate> Returns the value of theitemPredicatesrecord component.Optional<net.minecraft.advancements.critereon.ContextAwarePredicate> player()Returns the value of theplayerrecord component.booleantest(net.minecraft.world.item.ItemStack foodItemStack) Performs the check for the conditionsfinal 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.advancements.critereon.SimpleCriterionTrigger.SimpleInstance
validate
-
Field Details
-
DEFAULT_OUTPUT_ITEM_PREDICATES
public static final List<net.minecraft.advancements.critereon.ItemPredicate> DEFAULT_OUTPUT_ITEM_PREDICATES -
CODEC
public static final com.mojang.serialization.Codec<CitizenEatFoodTrigger.CitizenEatFoodTriggerInstance> CODEC
-
-
Constructor Details
-
CitizenEatFoodTriggerInstance
public CitizenEatFoodTriggerInstance(Optional<net.minecraft.advancements.critereon.ContextAwarePredicate> player, List<net.minecraft.advancements.critereon.ItemPredicate> itemPredicates) Creates an instance of aCitizenEatFoodTriggerInstancerecord class.- Parameters:
player- the value for theplayerrecord componentitemPredicates- the value for theitemPredicatesrecord component
-
-
Method Details
-
citizenEatFood
public static net.minecraft.advancements.Criterion<CitizenEatFoodTrigger.CitizenEatFoodTriggerInstance> citizenEatFood() -
citizenEatFood
public static net.minecraft.advancements.Criterion<CitizenEatFoodTrigger.CitizenEatFoodTriggerInstance> citizenEatFood(List<net.minecraft.advancements.critereon.ItemPredicate> itemPredicates) Construct the check with a single item condition- Parameters:
itemPredicates- the food item that has to be eaten to succeed
-
test
public boolean test(net.minecraft.world.item.ItemStack foodItemStack) Performs the check for the conditions- Parameters:
foodItemStack- the stack of food that was just consumed- Returns:
- whether the check succeeded
-
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 interfacenet.minecraft.advancements.critereon.SimpleCriterionTrigger.SimpleInstance- Returns:
- the value of the
playerrecord component
-
itemPredicates
Returns the value of theitemPredicatesrecord component.- Returns:
- the value of the
itemPredicatesrecord component
-