java.lang.Object
tech.guilhermekaua.spigotboot.inventoryapi.internal.listener.ViewListener
All Implemented Interfaces:
org.bukkit.event.Listener

@Internal public final class ViewListener extends Object implements 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

    Constructors
    Constructor
    Description
    ViewListener(@NotNull SessionRegistry sessions, @NotNull ViewEngine engine)
    Creates the listener.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onClick(org.bukkit.event.inventory.InventoryClickEvent event)
    Routes inventory clicks of players with an open view session into the engine.
    void
    onClose(org.bukkit.event.inventory.InventoryCloseEvent event)
    Bridges container closes into the engine; the engine guards by container identity.
    void
    onDrag(org.bukkit.event.inventory.InventoryDragEvent event)
    Applies the session drag policy to drags of players with an open view session.
    void
    onPluginDisable(org.bukkit.event.server.PluginDisableEvent event)
    Closes every open session when the plugin owning the inventory-api runtime disables.
    void
    onQuit(org.bukkit.event.player.PlayerQuitEvent event)
    Closes the quitting player's session with the DISCONNECT reason.

    Methods inherited from class java.lang.Object

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

    • ViewListener

      public ViewListener(@NotNull @NotNull SessionRegistry sessions, @NotNull @NotNull ViewEngine engine)
      Creates the listener.
      Parameters:
      sessions - the per-player session registry
      engine - 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