Class GuiView
java.lang.Object
com.github.darksoulq.abyssallib.world.gui.GuiView
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines the target inventory segment for rendering or interaction. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose(org.bukkit.entity.HumanEntity player) Closes the inventory for the specified player and triggers the close handler.org.bukkit.inventory.InventoryGets the bottom inventory segment (the player's inventory).getElementAt(GuiView.Segment segment, int slot) Retrieves the element assigned to a specific slot.getGui()Gets the GUI template used by this view.org.bukkit.inventory.InventoryViewGets the Bukkit InventoryView.org.bukkit.entity.PlayerGets the Player viewing this GUIorg.bukkit.inventory.InventorygetTop()Gets the top inventory segment (the custom GUI).voidrender()Updates the state of the GUI for the current tick.
-
Constructor Details
-
GuiView
Constructs a new GuiView instance.- Parameters:
gui- the gui templateview- the active inventory view
-
-
Method Details
-
getGui
-
getInventoryView
public org.bukkit.inventory.InventoryView getInventoryView()Gets the Bukkit InventoryView.- Returns:
- the inventory view
-
getPlayer
public org.bukkit.entity.Player getPlayer()Gets the Player viewing this GUI- Returns:
- The player
-
getTop
public org.bukkit.inventory.Inventory getTop()Gets the top inventory segment (the custom GUI).- Returns:
- the top inventory
-
getBottom
public org.bukkit.inventory.Inventory getBottom()Gets the bottom inventory segment (the player's inventory).- Returns:
- the player inventory
-
render
public void render()Updates the state of the GUI for the current tick.This method renders all active layers, executes ticker logic, and updates slot contents based on the elements defined in the Gui.
-
close
public void close(org.bukkit.entity.HumanEntity player) Closes the inventory for the specified player and triggers the close handler.- Parameters:
player- the player viewing the GUI
-
getElementAt
Retrieves the element assigned to a specific slot.- Parameters:
segment- the inventory segmentslot- the slot index- Returns:
- the GuiElement, or null if empty
-