Class BrewingRecipe

java.lang.Object
me.mehboss.brewing.BrewingRecipe

public class BrewingRecipe extends Object
Handles runtime logic for custom brewing recipes.

This class:

  • Locates matching brewing recipes based on inventory contents
  • Starts and manages brewing timers
  • Consumes fuel and ingredients
  • Controls progress via NBT BrewTime
  • Applies custom brewing results

Note: This class does not store recipe definitions. All recipe data is stored within BrewingRecipeData via RecipeUtil.

  • Constructor Details

    • BrewingRecipe

      public BrewingRecipe()
  • Method Details

    • getRecipe

      public static BrewingRecipeData getRecipe(org.bukkit.inventory.BrewerInventory inventory)
      Attempts to locate a brewing recipe that matches the given brewer inventory.

      Matching criteria:

      • Ingredient slot item matches recipe ingredient
      • Fuel slot item matches recipe fuel
      • Recipe is active
      • Player has permission (if required)
      • World is not disabled
      Parameters:
      inventory - The brewing stand inventory to match.
      Returns:
      A matching BrewingRecipeData, or null if none match.
    • startBrewing

      public static void startBrewing(org.bukkit.inventory.BrewerInventory inventory, BrewingRecipeData recipe)
      Begins a brewing cycle using the provided recipe.

      The default brewing time is 400 ticks (20 seconds), unless overridden in BrewingRecipe.BrewClock.

      This method:

      • Consumes fuel if internal fuel tank is empty
      • Initializes a BrewingRecipe.BrewClock to track progress
      Parameters:
      inventory - Brewer inventory involved in brewing.
      recipe - The recipe to brew.