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

    Constructors
    Constructor
    Description
    BrewingRecipe(@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 a BrewingRecipe record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @NotNull net.minecraft.world.item.crafting.Ingredient
    Returns the value of the ingredient record component.
    @NotNull net.minecraft.world.item.crafting.Ingredient
    Returns the value of the input record component.
    boolean
    isIngredient(net.minecraft.world.item.ItemStack ingredient)
    Checks whether the given ItemStack is a valid ingredient for this recipe.
    boolean
    isInput(@NotNull net.minecraft.world.item.ItemStack stack)
    Checks whether the given ItemStack is a valid input for this recipe.
    @NotNull net.minecraft.world.item.ItemStack
    Returns the value of the output record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface 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 a BrewingRecipe record class.
      Parameters:
      input - the value for the input record component
      ingredient - the value for the ingredient record component
      output - the value for the output record component
  • Method Details

    • isInput

      public boolean isInput(@NotNull @NotNull net.minecraft.world.item.ItemStack stack)
      Description copied from interface: IBrewingRecipe
      Checks whether the given ItemStack is 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:
      isInput in interface IBrewingRecipe
      Parameters:
      stack - the ItemStack to test
      Returns:
      true if the item is a valid input, otherwise false
    • isIngredient

      public boolean isIngredient(net.minecraft.world.item.ItemStack ingredient)
      Description copied from interface: IBrewingRecipe
      Checks whether the given ItemStack is 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:
      isIngredient in interface IBrewingRecipe
      Parameters:
      ingredient - the ItemStack to test
      Returns:
      true if the item is a valid ingredient, otherwise false
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • input

      @NotNull public @NotNull net.minecraft.world.item.crafting.Ingredient input()
      Returns the value of the input record component.
      Specified by:
      input in interface IBrewingRecipe
      Returns:
      the value of the input record component
    • ingredient

      @NotNull public @NotNull net.minecraft.world.item.crafting.Ingredient ingredient()
      Returns the value of the ingredient record component.
      Specified by:
      ingredient in interface IBrewingRecipe
      Returns:
      the value of the ingredient record component
    • output

      @NotNull public @NotNull net.minecraft.world.item.ItemStack output()
      Returns the value of the output record component.
      Specified by:
      output in interface IBrewingRecipe
      Returns:
      the value of the output record component