Package org.yuemi.libs.api.gui
Interface Gui
public interface Gui
Represents an interactive user interface inventory.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a layout layer to the GUI.@NotNull ClosePolicyGets the configured close policy for this GUI.@NotNull Collection<GuiLayer> Gets all layers registered in this GUI, ordered by priority.Consumer<org.bukkit.entity.Player> Gets the configured callback executed when the GUI is closed.intgetRows()Gets the number of rows in the GUI.@NotNull StringgetTitle()Gets the title of the GUI.voidopen(@NotNull org.bukkit.entity.Player player) Opens this GUI for the specified player.voidremoveLayer(@NotNull String layerId) Removes a layer from the GUI by its unique ID.voidsetClosePolicy(@NotNull ClosePolicy closePolicy) Sets the close policy for this GUI.voidupdate(@NotNull org.bukkit.entity.Player player) Re-renders the GUI for the player by re-evaluating conditions and layers.voidupdateTitle(@NotNull org.bukkit.entity.Player player, @NotNull String title) Updates the title of the GUI for the player if they have it open.
-
Method Details
-
getTitle
Gets the title of the GUI.- Returns:
- the title
-
getRows
int getRows()Gets the number of rows in the GUI.- Returns:
- the number of rows (1 to 6)
-
addLayer
Adds a layout layer to the GUI.- Parameters:
layer- the layer to add
-
removeLayer
Removes a layer from the GUI by its unique ID.- Parameters:
layerId- the ID of the layer to remove
-
getLayers
Gets all layers registered in this GUI, ordered by priority.- Returns:
- a collection of layers
-
open
void open(@NotNull @NotNull org.bukkit.entity.Player player) Opens this GUI for the specified player.- Parameters:
player- the player to open the GUI for
-
update
void update(@NotNull @NotNull org.bukkit.entity.Player player) Re-renders the GUI for the player by re-evaluating conditions and layers.- Parameters:
player- the player to update the GUI for
-
updateTitle
Updates the title of the GUI for the player if they have it open.- Parameters:
player- the player to update the title fortitle- the new title
-
getClosePolicy
Gets the configured close policy for this GUI.- Returns:
- the close policy
-
setClosePolicy
Sets the close policy for this GUI.- Parameters:
closePolicy- the close policy
-
getOnClose
Gets the configured callback executed when the GUI is closed.- Returns:
- the close callback, or null if none is configured
-