Class ViewListener
java.lang.Object
tech.guilhermekaua.spigotboot.inventoryapi.internal.listener.ViewListener
- All Implemented Interfaces:
org.bukkit.event.Listener
Single Bukkit listener bridge of the v3 view engine: resolves the clicking, dragging,
closing, quitting or disabling player's session in the
SessionRegistry and
delegates to the matching ViewEngine entry point. Events of players without a
session are ignored.
Auto-registered with Bukkit by spigot-boot's BukkitListenerAutoRegistrar when
the context becomes ready — no manual registerEvents call required.
-
Constructor Summary
ConstructorsConstructorDescriptionViewListener(@NotNull SessionRegistry sessions, @NotNull ViewEngine engine) Creates the listener. -
Method Summary
Modifier and TypeMethodDescriptionvoidonClick(org.bukkit.event.inventory.InventoryClickEvent event) Routes inventory clicks of players with an open view session into the engine.voidonClose(org.bukkit.event.inventory.InventoryCloseEvent event) Bridges container closes into the engine; the engine guards by container identity.voidonDrag(org.bukkit.event.inventory.InventoryDragEvent event) Applies the session drag policy to drags of players with an open view session.voidonPluginDisable(org.bukkit.event.server.PluginDisableEvent event) Closes every open session when the plugin owning the inventory-api runtime disables.voidonQuit(org.bukkit.event.player.PlayerQuitEvent event) Closes the quitting player's session with the DISCONNECT reason.
-
Constructor Details
-
ViewListener
public ViewListener(@NotNull @NotNull SessionRegistry sessions, @NotNull @NotNull ViewEngine engine) Creates the listener.- Parameters:
sessions- the per-player session registryengine- the engine receiving the bridged events
-
-
Method Details
-
onClick
public void onClick(org.bukkit.event.inventory.InventoryClickEvent event) Routes inventory clicks of players with an open view session into the engine.- Parameters:
event- the Bukkit event
-
onDrag
public void onDrag(org.bukkit.event.inventory.InventoryDragEvent event) Applies the session drag policy to drags of players with an open view session.- Parameters:
event- the Bukkit event
-
onClose
public void onClose(org.bukkit.event.inventory.InventoryCloseEvent event) Bridges container closes into the engine; the engine guards by container identity.- Parameters:
event- the Bukkit event
-
onQuit
public void onQuit(org.bukkit.event.player.PlayerQuitEvent event) Closes the quitting player's session with the DISCONNECT reason.- Parameters:
event- the Bukkit event
-
onPluginDisable
public void onPluginDisable(org.bukkit.event.server.PluginDisableEvent event) Closes every open session when the plugin owning the inventory-api runtime disables.- Parameters:
event- the Bukkit event
-