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
IBrewingRecipe
s inside of PotionBrewing
.
For queries, use the vanilla PotionBrewing
.
For registration, use RegisterBrewingRecipesEvent
.-
Field Summary
Modifier and TypeFieldDescriptionprivate final List
<IBrewingRecipe> The field for therecipes
record component. -
Constructor Summary
ConstructorDescriptionBrewingRecipeRegistry
(List<IBrewingRecipe> recipes) Creates an instance of aBrewingRecipeRegistry
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.Returns the output ItemStack obtained by brewing the passed input and ingredient.final int
hashCode()
Returns a hash code value for this object.boolean
Returns true if the passed input and ingredient have an outputboolean
isValidIngredient
(ItemStack stack) Returns true if the passed ItemStack is a valid ingredient for any of the recipes in the registry.boolean
isValidInput
(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 therecipes
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
recipes
The field for therecipes
record component.
-
-
Constructor Details
-
BrewingRecipeRegistry
Creates an instance of aBrewingRecipeRegistry
record class.- Parameters:
recipes
- the value for therecipes
record 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 therecipes
record component.- Returns:
- the value of the
recipes
record component
-