Class LogMenuListener

java.lang.Object
com.enhancedechest.listener.LogMenuListener
All Implemented Interfaces:
org.bukkit.event.Listener

public final class LogMenuListener extends Object implements org.bukkit.event.Listener
Drives the two inventories the /ee log feature opens:
  • the log viewer (LogMenuHolder) — a read-only paged list: every click is cancelled, a click on an event pane opens that snapshot, and the newer/older controls page;
  • the snapshot preview (LogSnapshotHolder) — a dupe-proof sandbox: the admin may rearrange items within the preview to inspect them, but no path can move an item into their own inventory or the world, and the cursor is cleared on close.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onClick(org.bukkit.event.inventory.InventoryClickEvent event)
     
    void
    onClose(org.bukkit.event.inventory.InventoryCloseEvent event)
    Discards the preview on close and returns to the log.
    void
    onDrag(org.bukkit.event.inventory.InventoryDragEvent event)
    A drag is allowed only if every affected slot is inside the snapshot inventory.

    Methods inherited from class java.lang.Object

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

    • LogMenuListener

      public LogMenuListener()
  • Method Details

    • onClick

      public void onClick(org.bukkit.event.inventory.InventoryClickEvent event)
    • onDrag

      public void onDrag(org.bukkit.event.inventory.InventoryDragEvent event)
      A drag is allowed only if every affected slot is inside the snapshot inventory.
    • onClose

      public void onClose(org.bukkit.event.inventory.InventoryCloseEvent event)
      Discards the preview on close and returns to the log. The inventory itself is a throwaway (never saved); the only thing that could leak a historical item is one left on the cursor, so clear it. Then re-open the log at the page the admin came from — openLog does its work asynchronously, so the actual openInventory lands a tick later, safely outside this close event.