Class Brewery
java.lang.Object
me.mehboss.brewing.Brewery
- All Implemented Interfaces:
org.bukkit.event.Listener
Handles the registration and execution of custom brewing recipes.
This class acts as the core manager for custom brewing logic by:
- Maintaining a static singleton reference for recipe access
- Listening for brewing stand inventory interactions
- Triggering custom brewing behavior when recipe inputs match
BrewingRecipe.getRecipe(BrewerInventory)
and executed using BrewingRecipe.startBrewing(BrewerInventory, BrewingRecipeData).-
Constructor Summary
ConstructorsConstructorDescriptionBrewery(org.bukkit.plugin.java.JavaPlugin plugin) Creates a new Brewery manager and registers it as an event listener. -
Method Summary
Modifier and TypeMethodDescriptionstatic Breweryorg.bukkit.plugin.java.JavaPluginvoidonBrewClick(org.bukkit.event.inventory.InventoryClickEvent event) Intercepts brewing stand clicks and evaluates whether custom brewing should begin.
-
Constructor Details
-
Brewery
public Brewery(org.bukkit.plugin.java.JavaPlugin plugin) Creates a new Brewery manager and registers it as an event listener.- Parameters:
plugin- The plugin instance that owns this brewing system.
-
-
Method Details
-
getInstance
-
getPlugin
public org.bukkit.plugin.java.JavaPlugin getPlugin() -
onBrewClick
public void onBrewClick(org.bukkit.event.inventory.InventoryClickEvent event) Intercepts brewing stand clicks and evaluates whether custom brewing should begin.This event handler:
- Ensures interaction occurred inside a brewing stand inventory
- Schedules a short delayed task (2 ticks) to allow item placement to finalize
- Attempts to match inputs to a
BrewingRecipeData - If matched, starts custom brewing via
BrewingRecipe.startBrewing(org.bukkit.inventory.BrewerInventory, me.mehboss.utils.data.BrewingRecipeData)
- Parameters:
event- The InventoryClickEvent triggered when a player interacts with an inventory.
-