Class InventoryOpenListener

java.lang.Object
com.ranull.graves.listener.InventoryOpenListener
All Implemented Interfaces:
org.bukkit.event.Listener

public class InventoryOpenListener extends Object implements org.bukkit.event.Listener
Listener for handling InventoryOpenEvent to manage interactions with grave inventories.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Graves
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs an InventoryOpenListener with the specified Graves plugin.
  • Method Summary

    Modifier and Type
    Method
    Description
    private 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • plugin

      private final Graves plugin
  • Constructor Details

    • InventoryOpenListener

      public InventoryOpenListener(Graves plugin)
      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.