Record Class BrewingRecipeRegistry
java.lang.Object
java.lang.Record
net.neoforged.neoforge.common.brewing.BrewingRecipeRegistry
Starting from 1.20.5 this is used to hold
IBrewingRecipes inside of PotionBrewing.
For queries, use the vanilla PotionBrewing.
For registration, use RegisterBrewingRecipesEvent.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<IBrewingRecipe> The field for therecipesrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionBrewingRecipeRegistry(List<IBrewingRecipe> recipes) Creates an instance of aBrewingRecipeRegistryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the output ItemStack obtained by brewing the passed input and ingredient.final inthashCode()Returns a hash code value for this object.booleanReturns true if the passed input and ingredient have an outputbooleanisValidIngredient(ItemStack stack) Returns true if the passed ItemStack is a valid ingredient for any of the recipes in the registry.booleanisValidInput(ItemStack stack) Returns true if the passed ItemStack is a valid input for any of the recipes in the registry.recipes()Returns the value of therecipesrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
recipes
The field for therecipesrecord component.
-
-
Constructor Details
-
BrewingRecipeRegistry
Creates an instance of aBrewingRecipeRegistryrecord class.- Parameters:
recipes- the value for therecipesrecord component
-
-
Method Details
-
getOutput
Returns the output ItemStack obtained by brewing the passed input and ingredient. -
hasOutput
Returns true if the passed input and ingredient have an output -
isValidIngredient
Returns true if the passed ItemStack is a valid ingredient for any of the recipes in the registry. -
isValidInput
Returns true if the passed ItemStack is a valid input for any of the recipes in the registry. -
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). -
recipes
Returns the value of therecipesrecord component.- Returns:
- the value of the
recipesrecord component
-