Record Class PotionIngredient
java.lang.Object
java.lang.Record
net.minecraft.world.item.crafting.PotionIngredient
public record PotionIngredient(Ingredient ingredient, Optional<PotionsPredicate> potions)
extends Record
implements Predicate<ItemStack>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IngredientThe field for theingredientrecord component.static final com.mojang.serialization.MapCodec<PotionIngredient> private final Optional<PotionsPredicate> The field for thepotionsrecord component.static final StreamCodec<RegistryFriendlyByteBuf, PotionIngredient> -
Constructor Summary
ConstructorsConstructorDescriptionPotionIngredient(Ingredient ingredient, Optional<PotionsPredicate> potions) Creates an instance of aPotionIngredientrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theingredientrecord component.static booleanisPotionInput(ItemStack itemStack, RecipeAccess recipeAccess) static PotionIngredientstatic PotionIngredientof(Item item, PotionsPredicate potions) potions()Returns the value of thepotionsrecord component.booleanfinal StringtoString()Returns a string representation of this record class.
-
Field Details
-
ingredient
The field for theingredientrecord component. -
potions
The field for thepotionsrecord component. -
MAP_CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
PotionIngredient
Creates an instance of aPotionIngredientrecord class.- Parameters:
ingredient- the value for theingredientrecord componentpotions- the value for thepotionsrecord component
-
-
Method Details
-
test
-
of
-
of
-
isPotionInput
-
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). -
ingredient
Returns the value of theingredientrecord component.- Returns:
- the value of the
ingredientrecord component
-
potions
Returns the value of thepotionsrecord component.- Returns:
- the value of the
potionsrecord component
-