Class BrewingRecipe
java.lang.Object
me.mehboss.brewing.BrewingRecipe
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BrewingRecipeDatagetRecipe(org.bukkit.inventory.BrewerInventory inventory) Attempts to locate a brewing recipe that matches the given brewer inventory.static voidstartBrewing(org.bukkit.inventory.BrewerInventory inventory, BrewingRecipeData recipe) Begins a brewing cycle using the provided recipe.
-
Constructor Details
-
BrewingRecipe
public BrewingRecipe()
-
-
Method Details
-
getRecipe
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, ornullif 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.BrewClockto track progress
- Parameters:
inventory- Brewer inventory involved in brewing.recipe- The recipe to brew.
-