Interface EmiRecipeHandler<T extends Container>

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

public interface EmiRecipeHandler<T extends Container>
The base recipe handler. In most cases, implementing this is not necessary, and StandardRecipeHandler can be used instead.
  • Field Details

    • NOT_ENOUGH_INGREDIENTS

      static final Text NOT_ENOUGH_INGREDIENTS
  • Method Details

    • getInventory

      EmiPlayerInventory getInventory(GuiContainer screen)
      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.
    • supportsRecipe

      boolean supportsRecipe(EmiRecipe recipe)
      Returns:
      Whether the handler is applicable for the provided recipe.
    • alwaysDisplaySupport

      default boolean alwaysDisplaySupport(EmiRecipe recipe)
      Returns:
      Whether the recipe should always display the ability to be filled if supported by this handler. When returning true, the recipe screen will always display a grayed out fill button in all contexts. Useful for recipe handlers which support nearly every recipe, and do not want to pollute the recipe screen.
    • canCraft

      boolean canCraft(EmiRecipe recipe, EmiCraftContext<T> context)
      Returns:
      Whether the handler can craft the provided recipe with the given context
    • craft

      boolean craft(EmiRecipe recipe, EmiCraftContext<T> context)
      Returns:
      Whether the craft was successful
    • getTooltip

      default List<TooltipComponent> getTooltip(EmiRecipe recipe, EmiCraftContext<T> context)
      Returns:
      The tooltip describing status for crafting the recipe
    • render

      default void render(EmiRecipe recipe, EmiCraftContext<T> context, List<Widget> widgets, DrawContext draw)
      Render feedback about the status of the current fill. Common use is to render an overlay on missing ingredients