Record Class BrewingRecipe
java.lang.Object
java.lang.Record
net.ixdarklord.coolcatcore.api.brewing.BrewingRecipe
- All Implemented Interfaces:
IBrewingRecipe
public record BrewingRecipe(@NotNull net.minecraft.world.item.crafting.Ingredient input, @NotNull net.minecraft.world.item.crafting.Ingredient ingredient, @NotNull net.minecraft.world.item.ItemStack output)
extends Record
implements IBrewingRecipe
-
Constructor Summary
ConstructorsConstructorDescriptionBrewingRecipe(@NotNull net.minecraft.world.item.crafting.Ingredient input, @NotNull net.minecraft.world.item.crafting.Ingredient ingredient, @NotNull net.minecraft.world.item.ItemStack output) Creates an instance of aBrewingReciperecord 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.@NotNull net.minecraft.world.item.crafting.IngredientReturns the value of theingredientrecord component.@NotNull net.minecraft.world.item.crafting.Ingredientinput()Returns the value of theinputrecord component.booleanisIngredient(net.minecraft.world.item.ItemStack ingredient) Checks whether the givenItemStackis a valid ingredient for this recipe.booleanisInput(@NotNull net.minecraft.world.item.ItemStack stack) Checks whether the givenItemStackis a valid input for this recipe.@NotNull net.minecraft.world.item.ItemStackoutput()Returns the value of theoutputrecord component.final 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.ixdarklord.coolcatcore.api.brewing.IBrewingRecipe
getOutput
-
Constructor Details
-
BrewingRecipe
public BrewingRecipe(@NotNull @NotNull net.minecraft.world.item.crafting.Ingredient input, @NotNull @NotNull net.minecraft.world.item.crafting.Ingredient ingredient, @NotNull @NotNull net.minecraft.world.item.ItemStack output) Creates an instance of aBrewingReciperecord class.- Parameters:
input- the value for theinputrecord componentingredient- the value for theingredientrecord componentoutput- the value for theoutputrecord component
-
-
Method Details
-
isInput
public boolean isInput(@NotNull @NotNull net.minecraft.world.item.ItemStack stack) Description copied from interface:IBrewingRecipeChecks whether the givenItemStackis a valid input for this recipe."Input" refers to the item placed in one of the three bottom slots of the brewing stand (e.g., a water bottle).
- Specified by:
isInputin interfaceIBrewingRecipe- Parameters:
stack- theItemStackto test- Returns:
trueif the item is a valid input, otherwisefalse
-
isIngredient
public boolean isIngredient(net.minecraft.world.item.ItemStack ingredient) Description copied from interface:IBrewingRecipeChecks whether the givenItemStackis a valid ingredient for this recipe."Ingredient" refers to the item placed in the top slot of the brewing stand (e.g., nether wart).
- Specified by:
isIngredientin interfaceIBrewingRecipe- Parameters:
ingredient- theItemStackto test- Returns:
trueif the item is a valid ingredient, otherwisefalse
-
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). -
input
@NotNull public @NotNull net.minecraft.world.item.crafting.Ingredient input()Returns the value of theinputrecord component.- Specified by:
inputin interfaceIBrewingRecipe- Returns:
- the value of the
inputrecord component
-
ingredient
@NotNull public @NotNull net.minecraft.world.item.crafting.Ingredient ingredient()Returns the value of theingredientrecord component.- Specified by:
ingredientin interfaceIBrewingRecipe- Returns:
- the value of the
ingredientrecord component
-
output
@NotNull public @NotNull net.minecraft.world.item.ItemStack output()Returns the value of theoutputrecord component.- Specified by:
outputin interfaceIBrewingRecipe- Returns:
- the value of the
outputrecord component
-