Package com.enhancedechest.listener
Class LogMenuListener
java.lang.Object
com.enhancedechest.listener.LogMenuListener
- All Implemented Interfaces:
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 -
Method Summary
Modifier and TypeMethodDescriptionvoidonClick(org.bukkit.event.inventory.InventoryClickEvent event) voidonClose(org.bukkit.event.inventory.InventoryCloseEvent event) Discards the preview on close and returns to the log.voidonDrag(org.bukkit.event.inventory.InventoryDragEvent event) A drag is allowed only if every affected slot is inside the snapshot inventory.
-
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 —openLogdoes its work asynchronously, so the actualopenInventorylands a tick later, safely outside this close event.
-