Class GuiLayoutBuilder
java.lang.Object
github.nighter.smartspawner.api.gui.GuiLayoutBuilder
Builder for creating
GuiLayoutData instances programmatically.
Used in the SmartSpawner Developer API to define custom GUI layouts.
Example usage:
GuiLayoutData layout = new GuiLayoutBuilder()
.type(GuiLayoutType.MAIN_GUI)
.addButton(new GuiButtonBuilder().slot(11).material(Material.CHEST).action("click", "open_storage").build())
.build();
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddButton(GuiButtonData button) Adds a button to this layout.addButton(String key, GuiButtonData button) Adds a button with a specific key to this layout.build()Builds theGuiLayoutDatainstance.type(GuiLayoutType type) Sets the layout type.
-
Constructor Details
-
GuiLayoutBuilder
public GuiLayoutBuilder()
-
-
Method Details
-
type
Sets the layout type.- Parameters:
type- the GUI layout type- Returns:
- this builder
-
addButton
Adds a button to this layout.- Parameters:
button- the button data- Returns:
- this builder
-
addButton
Adds a button with a specific key to this layout.- Parameters:
key- the button key (e.g., "slot_11")button- the button data- Returns:
- this builder
-
build
-