Record Class BarrelTapRecipe

java.lang.Object
java.lang.Record
tech.anonymoushacker1279.immersiveweapons.item.crafting.BarrelTapRecipe
All Implemented Interfaces:
net.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>

public record BarrelTapRecipe(net.minecraft.resources.ResourceLocation recipeId, net.minecraft.world.item.crafting.Ingredient material, int materialCount, net.minecraft.world.item.ItemStack result) extends Record implements net.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    BarrelTapRecipe(net.minecraft.resources.ResourceLocation recipeId, net.minecraft.world.item.crafting.Ingredient material, int materialCount, net.minecraft.world.item.ItemStack result)
    Constructor for BarrelTapRecipe.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.item.ItemStack
    assemble(net.minecraft.world.Container container, net.minecraft.core.RegistryAccess registryAccess)
    Returns an Item that is the result of this recipe.
    boolean
    canCraftInDimensions(int width, int height)
    Used to determine if this recipe can fit in a grid of the given width/height.
    final boolean
    Indicates whether some other object is "equal to" this one.
    net.minecraft.resources.ResourceLocation
    Get the recipe ID.
    net.minecraft.core.NonNullList<net.minecraft.world.item.crafting.Ingredient>
    Get the recipe's ingredients.
    net.minecraft.world.item.crafting.Ingredient
     
    int
     
    net.minecraft.world.item.ItemStack
    getResultItem(net.minecraft.core.RegistryAccess registryAccess)
     
    net.minecraft.world.item.crafting.RecipeSerializer<?>
    Get the recipe serializer.
    net.minecraft.world.item.ItemStack
    Get the toast symbol.
    net.minecraft.world.item.crafting.RecipeType<?>
    Get the recipe type.
    final int
    Returns a hash code value for this object.
    boolean
    matches(net.minecraft.world.Container container, net.minecraft.world.level.Level level)
    Used to check if a recipe matches current crafting inventory.
    net.minecraft.world.item.crafting.Ingredient
    Returns the value of the material record component.
    int
    Returns the value of the materialCount record component.
    net.minecraft.resources.ResourceLocation
    Returns the value of the recipeId record component.
    net.minecraft.world.item.ItemStack
    Returns the value of the result record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface net.minecraft.world.item.crafting.Recipe

    getGroup, getRemainingItems, isIncomplete, isSpecial, showNotification
  • Constructor Details

    • BarrelTapRecipe

      public BarrelTapRecipe(net.minecraft.resources.ResourceLocation recipeId, net.minecraft.world.item.crafting.Ingredient material, int materialCount, net.minecraft.world.item.ItemStack result)
      Constructor for BarrelTapRecipe.
      Parameters:
      recipeId - the ResourceLocation for the recipe
      material - the first Ingredient
      materialCount - the number of materials needed for the recipe
      result - an ItemStack formed from the material
  • Method Details

    • matches

      public boolean matches(net.minecraft.world.Container container, net.minecraft.world.level.Level level)
      Used to check if a recipe matches current crafting inventory.
      Specified by:
      matches in interface net.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
      Parameters:
      container - the Container instance
      level - the current Level
      Returns:
      boolean
    • assemble

      public net.minecraft.world.item.ItemStack assemble(net.minecraft.world.Container container, net.minecraft.core.RegistryAccess registryAccess)
      Returns an Item that is the result of this recipe.
      Specified by:
      assemble in interface net.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
      Parameters:
      container - the Container instance
      Returns:
      ItemStack
    • canCraftInDimensions

      public boolean canCraftInDimensions(int width, int height)
      Used to determine if this recipe can fit in a grid of the given width/height.
      Specified by:
      canCraftInDimensions in interface net.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
      Parameters:
      width - the width of the grid
      height - the height of the grid
      Returns:
      boolean
    • getMaterial

      public net.minecraft.world.item.crafting.Ingredient getMaterial()
    • getMaterialCount

      public int getMaterialCount()
    • getResultItem

      public net.minecraft.world.item.ItemStack getResultItem(net.minecraft.core.RegistryAccess registryAccess)
      Specified by:
      getResultItem in interface net.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
    • getToastSymbol

      public net.minecraft.world.item.ItemStack getToastSymbol()
      Get the toast symbol.
      Specified by:
      getToastSymbol in interface net.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
      Returns:
      ItemStack
    • getId

      public net.minecraft.resources.ResourceLocation getId()
      Get the recipe ID.
      Specified by:
      getId in interface net.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
      Returns:
      ResourceLocation
    • getSerializer

      public net.minecraft.world.item.crafting.RecipeSerializer<?> getSerializer()
      Get the recipe serializer.
      Specified by:
      getSerializer in interface net.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
      Returns:
      RecipeSerializer
    • getType

      public net.minecraft.world.item.crafting.RecipeType<?> getType()
      Get the recipe type.
      Specified by:
      getType in interface net.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
      Returns:
      RecipeType
    • getIngredients

      public net.minecraft.core.NonNullList<net.minecraft.world.item.crafting.Ingredient> getIngredients()
      Get the recipe's ingredients.
      Specified by:
      getIngredients in interface net.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
      Returns:
      NonNullList extending Ingredient
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • recipeId

      public net.minecraft.resources.ResourceLocation recipeId()
      Returns the value of the recipeId record component.
      Returns:
      the value of the recipeId record component
    • material

      public net.minecraft.world.item.crafting.Ingredient material()
      Returns the value of the material record component.
      Returns:
      the value of the material record component
    • materialCount

      public int materialCount()
      Returns the value of the materialCount record component.
      Returns:
      the value of the materialCount record component
    • result

      public net.minecraft.world.item.ItemStack result()
      Returns the value of the result record component.
      Returns:
      the value of the result record component