Class RecipeBaseData<C extends net.minecraft.world.Container>

java.lang.Object
net.darkhax.bookshelf.api.data.recipes.RecipeBaseData<C>
Type Parameters:
C - The type of inventory used to craft the recipe. This can usually be ignored.
All Implemented Interfaces:
net.minecraft.world.item.crafting.Recipe<C>

public abstract class RecipeBaseData<C extends net.minecraft.world.Container> extends Object implements net.minecraft.world.item.crafting.Recipe<C>
A partial implementation of Recipe that is intended for recipes that are not crafted through an inventory or traditional crafting system. This implementation provides default behaviours to ignore the vanilla crafting system.

This approach is often preferred over defining your own reload listener as it allows the data to be synced to the client and maintains a load order that is beneficial for implementing support for mods like JEI and CraftTweaker.

  • Field Summary

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

    CODEC, CONDITIONAL_CODEC
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.item.ItemStack
    assemble(C c, net.minecraft.core.RegistryAccess access)
     
    boolean
    canCraftInDimensions(int width, int height)
     
    net.minecraft.world.item.ItemStack
    getResultItem(net.minecraft.core.RegistryAccess access)
     
    boolean
    matches(C inventory, net.minecraft.world.level.Level level)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

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

    getGroup, getIngredients, getRemainingItems, getSerializer, getToastSymbol, getType, isIncomplete, isSpecial, showNotification
  • Constructor Details

    • RecipeBaseData

      public RecipeBaseData()
  • Method Details

    • matches

      public boolean matches(C inventory, net.minecraft.world.level.Level level)
      Specified by:
      matches in interface net.minecraft.world.item.crafting.Recipe<C extends net.minecraft.world.Container>
    • assemble

      public net.minecraft.world.item.ItemStack assemble(C c, net.minecraft.core.RegistryAccess access)
      Specified by:
      assemble in interface net.minecraft.world.item.crafting.Recipe<C extends net.minecraft.world.Container>
    • canCraftInDimensions

      public boolean canCraftInDimensions(int width, int height)
      Specified by:
      canCraftInDimensions in interface net.minecraft.world.item.crafting.Recipe<C extends net.minecraft.world.Container>
    • getResultItem

      public net.minecraft.world.item.ItemStack getResultItem(net.minecraft.core.RegistryAccess access)
      Specified by:
      getResultItem in interface net.minecraft.world.item.crafting.Recipe<C extends net.minecraft.world.Container>