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>
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
ConstructorsConstructorDescriptionBaseMenuView(@NotNull Lotus<C> lotus, M menu, @NotNull org.bukkit.entity.Player viewer, @NotNull DataRegistry data) -
Method Summary
Modifier and TypeMethodDescription@NotNull Capacitycapacity()Returns the resolved capacity.@NotNull Contentcontent()Returns the current content.@NotNull DataRegistrydata()Returns the per-view data registry.@Nullable org.bukkit.inventory.InventoryvoidhandleClick(@NotNull org.bukkit.event.inventory.InventoryClickEvent event) voidhandleClose(@NotNull org.bukkit.event.inventory.InventoryCloseEvent event) voidhandleDrag(@NotNull org.bukkit.event.inventory.InventoryDragEvent event) voidhandleOpen(@NotNull org.bukkit.event.inventory.InventoryOpenEvent event) booleanisOpen()Returns whether the view is currently open.lotus()Returns the Lotus runtime that owns this view.menu()Returns the menu template behind this view.voidopen(@NotNull ViewOpener<C> opener) voidrefresh()Rebuilds the resolved menu state and reapplies it to the live inventory.voidrenderInto(@NotNull org.bukkit.inventory.Inventory target) protected voidresolve()Resolves capacity and content from the template.title()Returns the title of the view.@NotNull org.bukkit.entity.Playerviewer()Returns the player viewing this menu.
-
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
Description copied from interface:MenuViewReturns the Lotus runtime that owns this view. -
viewer
@NotNull public @NotNull org.bukkit.entity.Player viewer()Description copied from interface:MenuViewReturns the player viewing this menu. -
data
Description copied from interface:MenuViewReturns the per-view data registry. -
capacity
Description copied from interface:MenuViewReturns the resolved capacity. -
title
Description copied from interface:MenuViewReturns the title of the view. -
content
Description copied from interface:MenuViewReturns the current content. -
getInventory
@Nullable public @Nullable org.bukkit.inventory.Inventory getInventory() -
isOpen
public boolean isOpen()Description copied from interface:MenuViewReturns whether the view is currently open. -
resolve
protected void resolve()Resolves capacity and content from the template. Idempotent — safe to call before each open. Title extraction is handled by theViewOpenerat inventory-creation time. -
open
-
refresh
public void refresh()Description copied from interface:MenuViewRebuilds 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.
-
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)
-