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

java.lang.Object
net.darkhax.bookshelf.api.data.recipes.RecipeBase<C>
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 RecipeBase<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.

  • Constructor Summary

    Constructors
    Constructor
    Description
    RecipeBaseData(net.minecraft.resources.ResourceLocation id)
     
  • 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 net.darkhax.bookshelf.api.data.recipes.RecipeBase

    getId

    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(net.minecraft.resources.ResourceLocation id)
  • Method Details

    • matches

      public boolean matches(C inventory, net.minecraft.world.level.Level level)
    • assemble

      public net.minecraft.world.item.ItemStack assemble(C c, net.minecraft.core.RegistryAccess access)
    • canCraftInDimensions

      public boolean canCraftInDimensions(int width, int height)
    • getResultItem

      public net.minecraft.world.item.ItemStack getResultItem(net.minecraft.core.RegistryAccess access)