Class AbstractGui
java.lang.Object
com.github.darksoulq.abyssallib.world.gui.Gui
com.github.darksoulq.abyssallib.world.gui.AbstractGui
An abstract base implementation of a Graphical User Interface (GUI).
This class serves as a template for creating custom menus by providing
lifecycle hooks and simplified methods for managing elements, flags, and layers.
-
Nested Class Summary
Nested classes/interfaces inherited from class Gui
Gui.Builder -
Constructor Summary
ConstructorsConstructorDescriptionAbstractGui(org.bukkit.inventory.MenuType menuType, net.kyori.adventure.text.Component title, int tickInterval) Constructs a new AbstractGui with the specified menu type and title. -
Method Summary
Modifier and TypeMethodDescriptionvoidEnables a specific behavior or restriction flag for this GUI.voidEnables multiple behavior or restriction flags for this GUI.voidAdds a functional layer to the GUI.voidset(SlotPosition pos, GuiElement element) Assigns aGuiElementto a specific position within the GUI grid.Methods inherited from class Gui
builder, getElements, getFlags, getLayers, getMenuType, getOnClose, getOnOpen, getTickers, getTickInterval, getTitle, hasFlag
-
Constructor Details
-
AbstractGui
public AbstractGui(org.bukkit.inventory.MenuType menuType, net.kyori.adventure.text.Component title, int tickInterval) Constructs a new AbstractGui with the specified menu type and title. Initializes internal collections including a HashMap for elements and LinkedLists for layers and animations.- Parameters:
menuType- TheMenuTypedefining the size and shape of the inventory.title- TheComponentrepresenting the display name of the menu.tickInterval- The interval between each GuiView#render call
-
-
Method Details
-
set
Assigns aGuiElementto a specific position within the GUI grid.- Parameters:
pos- TheSlotPositionwhere the element should be placed.element- TheGuiElementto be rendered at the specified position.
-
addFlag
-
addFlags
-
addLayer
-