Class Gui
java.lang.Object
com.github.darksoulq.abyssallib.world.gui.Gui
- Direct Known Subclasses:
AbstractGui
Represents a template for a custom Graphical User Interface.
A Gui instance stores the menu configuration, including its type, title,
static elements, visual layers, and event handlers. It is intended to
be constructed via its Gui.Builder.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA fluent builder for creating Gui configurations. -
Constructor Summary
ConstructorsConstructorDescriptionGui(org.bukkit.inventory.MenuType menuType, net.kyori.adventure.text.Component title, Map<SlotPosition, GuiElement> elements, List<GuiLayer> layers, List<Consumer<GuiView>> tickers, EnumSet<GuiFlag> flags, int tickInterval, Consumer<GuiView> onOpen, Consumer<GuiView> onClose) Constructs a new Gui configuration. -
Method Summary
Modifier and TypeMethodDescriptionstatic Gui.Builderbuilder(org.bukkit.inventory.MenuType type, net.kyori.adventure.text.Component title) Creates a new builder for a Gui.Gets the map of slot positions to GUI elements.getFlags()Gets all behavior flags associated with this GUI.Gets the list of visual layers.org.bukkit.inventory.MenuTypeGets the MenuType of this GUI.Gets the closure event handler.Gets the opening event handler.Gets the list of per-tick update handlers.intGets the interval between eachGuiView#rendercall.net.kyori.adventure.text.ComponentgetTitle()Gets the title component of this GUI.booleanChecks if a specific behavior flag is set.
-
Constructor Details
-
Gui
public Gui(org.bukkit.inventory.MenuType menuType, net.kyori.adventure.text.Component title, Map<SlotPosition, GuiElement> elements, List<GuiLayer> layers, List<Consumer<GuiView>> tickers, EnumSet<GuiFlag> flags, int tickInterval, Consumer<GuiView> onOpen, Consumer<GuiView> onClose) Constructs a new Gui configuration.- Parameters:
menuType- the type of inventorytitle- the inventory titleelements- the static element maplayers- the list of rendering layerstickers- the list of tick handlersflags- the behavior flagsonOpen- the open handleronClose- the close handler
-
-
Method Details
-
getMenuType
public org.bukkit.inventory.MenuType getMenuType()Gets the MenuType of this GUI.- Returns:
- the menu type
-
getOnClose
-
getOnOpen
-
getTickers
-
getLayers
-
getElements
Gets the map of slot positions to GUI elements.- Returns:
- the element map
-
hasFlag
Checks if a specific behavior flag is set.- Parameters:
flag- the flag to check- Returns:
- true if the flag is present
-
getFlags
-
getTickInterval
public int getTickInterval()Gets the interval between eachGuiView#rendercall.- Returns:
- The interval between render calls
-
getTitle
public net.kyori.adventure.text.Component getTitle()Gets the title component of this GUI.- Returns:
- the title
-
builder
public static Gui.Builder builder(org.bukkit.inventory.MenuType type, net.kyori.adventure.text.Component title) Creates a new builder for a Gui.- Parameters:
type- the menu typetitle- the menu title- Returns:
- a new builder instance
-