Interface StandardRecipeHandler<T extends Container>

All Superinterfaces:
EmiRecipeHandler<T>
All Known Implementing Classes:
BulkRecipeHandler, CoercedRecipeHandler, CookingRecipeHandler, CraftingRecipeHandler, InventoryRecipeHandler, SouforgeRecipeHandler, SoulforgeCraftingRecipeHandler

public interface StandardRecipeHandler<T extends Container> extends EmiRecipeHandler<T>
  • Method Details

    • getInputSources

      List<Slot> getInputSources(T handler)
      Returns:
      The slots for the recipe handler to source ingredients from. Typically this should include the player's inventory, and crafting slots.
    • getCraftingSlots

      List<Slot> getCraftingSlots(T handler)
      Returns:
      The slots where inputs should be placed to perform crafting.
    • getCraftingSlots

      default List<Slot> getCraftingSlots(EmiRecipe recipe, T handler)
      Returns:
      The slots where inputs should be placed to perform crafting for a particular context.
    • getOutputSlot

      @Nullable default @Nullable Slot getOutputSlot(T handler)
      Returns:
      The output slot for recipe handlers that support instant interaction, like crafting tables. For handlers that have processing time, or where this concept is otherwise inapplicable, null.
    • getInventory

      default EmiPlayerInventory getInventory(GuiContainer screen)
      Specified by:
      getInventory in interface EmiRecipeHandler<T extends Container>
      Returns:
      An inventory with the stacks the player can use for crafting. Craftables can only ever be discovered if the inventory contains one of its ingredients. A changed inventory indicates that EMI needs to refresh craftables.
    • canCraft

      default boolean canCraft(EmiRecipe recipe, EmiCraftContext<T> context)
      Specified by:
      canCraft in interface EmiRecipeHandler<T extends Container>
      Returns:
      Whether the handler can craft the provided recipe with the given context
    • craft

      default boolean craft(EmiRecipe recipe, EmiCraftContext<T> context)
      Specified by:
      craft in interface EmiRecipeHandler<T extends Container>
      Returns:
      Whether the craft was successful
    • render

      default void render(EmiRecipe recipe, EmiCraftContext<T> context, List<Widget> widgets, DrawContext draw)
      Description copied from interface: EmiRecipeHandler
      Render feedback about the status of the current fill. Common use is to render an overlay on missing ingredients
      Specified by:
      render in interface EmiRecipeHandler<T extends Container>
    • renderMissing

      @Internal static void renderMissing(EmiRecipe recipe, EmiPlayerInventory inv, List<Widget> widgets, DrawContext draw)
    • getAvailable

      @Internal static Map<EmiIngredient,Boolean> getAvailable(EmiRecipe recipe, EmiPlayerInventory inventory)