Class BaseMenuView<C,M extends Menu<C>>

java.lang.Object
studio.mevera.lotus.internal.menu.BaseMenuView<C,M>
All Implemented Interfaces:
org.bukkit.inventory.InventoryHolder, MenuView<C,M>

public class BaseMenuView<C,M extends Menu<C>> extends Object implements MenuView<C,M>
Reference MenuView implementation. Holds the resolved capacity/content and the Bukkit Inventory once opened. Title extraction is delegated entirely to the platform-specific ViewOpener.
  • Constructor Summary

    Constructors
    Constructor
    Description
    BaseMenuView(@NotNull Lotus<C> lotus, M menu, @NotNull org.bukkit.entity.Player viewer, @NotNull DataRegistry data)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull Capacity
    Returns the resolved capacity.
    @NotNull Content
    Returns the current content.
    @NotNull DataRegistry
    Returns the per-view data registry.
    @Nullable org.bukkit.inventory.Inventory
     
    void
    handleClick(@NotNull org.bukkit.event.inventory.InventoryClickEvent event)
     
    void
    handleClose(@NotNull org.bukkit.event.inventory.InventoryCloseEvent event)
     
    void
    handleDrag(@NotNull org.bukkit.event.inventory.InventoryDragEvent event)
     
    void
    handleOpen(@NotNull org.bukkit.event.inventory.InventoryOpenEvent event)
     
    boolean
    Returns whether the view is currently open.
    @NotNull Lotus<C>
    Returns the Lotus runtime that owns this view.
    Returns the menu template behind this view.
    void
    open(@NotNull ViewOpener<C> opener)
     
    void
    Rebuilds the resolved menu state and reapplies it to the live inventory.
    void
    renderInto(@NotNull org.bukkit.inventory.Inventory target)
     
    protected void
    Resolves capacity and content from the template.
    Returns the title of the view.
    @NotNull org.bukkit.entity.Player
    Returns the player viewing this menu.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface studio.mevera.lotus.api.menu.MenuView

    type
  • Constructor Details

    • BaseMenuView

      public BaseMenuView(@NotNull @NotNull Lotus<C> lotus, @NotNull M menu, @NotNull @NotNull org.bukkit.entity.Player viewer, @NotNull @NotNull DataRegistry data)
  • Method Details

    • lotus

      @NotNull public @NotNull Lotus<C> lotus()
      Description copied from interface: MenuView
      Returns the Lotus runtime that owns this view.
      Specified by:
      lotus in interface MenuView<C,M extends Menu<C>>
    • viewer

      @NotNull public @NotNull org.bukkit.entity.Player viewer()
      Description copied from interface: MenuView
      Returns the player viewing this menu.
      Specified by:
      viewer in interface MenuView<C,M extends Menu<C>>
    • data

      @NotNull public @NotNull DataRegistry data()
      Description copied from interface: MenuView
      Returns the per-view data registry.
      Specified by:
      data in interface MenuView<C,M extends Menu<C>>
    • capacity

      @NotNull public @NotNull Capacity capacity()
      Description copied from interface: MenuView
      Returns the resolved capacity.
      Specified by:
      capacity in interface MenuView<C,M extends Menu<C>>
    • title

      @NotNull public C title()
      Description copied from interface: MenuView
      Returns the title of the view.
      Specified by:
      title in interface MenuView<C,M extends Menu<C>>
      Returns:
      the title of the view.
    • content

      @NotNull public @NotNull Content content()
      Description copied from interface: MenuView
      Returns the current content.
      Specified by:
      content in interface MenuView<C,M extends Menu<C>>
    • getInventory

      @Nullable public @Nullable org.bukkit.inventory.Inventory getInventory()
      Specified by:
      getInventory in interface org.bukkit.inventory.InventoryHolder
      Specified by:
      getInventory in interface MenuView<C,M extends Menu<C>>
    • isOpen

      public boolean isOpen()
      Description copied from interface: MenuView
      Returns whether the view is currently open.
      Specified by:
      isOpen in interface MenuView<C,M extends Menu<C>>
    • resolve

      protected void resolve()
      Resolves capacity and content from the template. Idempotent — safe to call before each open. Title extraction is handled by the ViewOpener at inventory-creation time.
    • open

      public void open(@NotNull @NotNull ViewOpener<C> opener)
    • refresh

      public void refresh()
      Description copied from interface: MenuView
      Rebuilds the resolved menu state and reapplies it to the live inventory.

      Implementations may recreate the inventory when structural properties such as title, type, or capacity change.

      Specified by:
      refresh in interface MenuView<C,M extends Menu<C>>
    • renderInto

      public void renderInto(@NotNull @NotNull org.bukkit.inventory.Inventory target)
    • handleClick

      public void handleClick(@NotNull @NotNull org.bukkit.event.inventory.InventoryClickEvent event)
    • handleDrag

      public void handleDrag(@NotNull @NotNull org.bukkit.event.inventory.InventoryDragEvent event)
    • handleOpen

      public void handleOpen(@NotNull @NotNull org.bukkit.event.inventory.InventoryOpenEvent event)
    • handleClose

      public void handleClose(@NotNull @NotNull org.bukkit.event.inventory.InventoryCloseEvent event)