Package com.ranull.graves.listener
Class InventoryOpenListener
java.lang.Object
com.ranull.graves.listener.InventoryOpenListener
- All Implemented Interfaces:
org.bukkit.event.Listener
Listener for handling InventoryOpenEvent to manage interactions with grave inventories.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInventoryOpenListener
(Graves plugin) Constructs an InventoryOpenListener with the specified Graves plugin. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
handleGraveInventoryOpen
(org.bukkit.event.inventory.InventoryOpenEvent event) Handles the opening of a Grave inventory by creating and triggering a GraveOpenEvent.private boolean
isGraveInventory
(org.bukkit.event.inventory.InventoryOpenEvent event) Checks if the inventory holder is a Grave.void
onInventoryOpen
(org.bukkit.event.inventory.InventoryOpenEvent event) Handles the InventoryOpenEvent to manage interactions with grave inventories.
-
Field Details
-
plugin
-
-
Constructor Details
-
InventoryOpenListener
Constructs an InventoryOpenListener with the specified Graves plugin.- Parameters:
plugin
- The Graves plugin instance.
-
-
Method Details
-
onInventoryOpen
public void onInventoryOpen(org.bukkit.event.inventory.InventoryOpenEvent event) Handles the InventoryOpenEvent to manage interactions with grave inventories. Creates and triggers a GraveOpenEvent when a Grave inventory is opened, and cancels the open event if the GraveOpenEvent is cancelled.- Parameters:
event
- The InventoryOpenEvent to handle.
-
isGraveInventory
private boolean isGraveInventory(org.bukkit.event.inventory.InventoryOpenEvent event) Checks if the inventory holder is a Grave.- Parameters:
event
- The InventoryOpenEvent.- Returns:
- True if the inventory holder is a Grave, false otherwise.
-
handleGraveInventoryOpen
private void handleGraveInventoryOpen(org.bukkit.event.inventory.InventoryOpenEvent event) Handles the opening of a Grave inventory by creating and triggering a GraveOpenEvent.- Parameters:
event
- The InventoryOpenEvent.
-