Interface GuiBuilder


public interface GuiBuilder
Fluent builder for creating Gui instances.
  • Method Details

    • title

      @NotNull @NotNull GuiBuilder title(@NotNull @NotNull String title)
      Sets the title of the GUI.
      Parameters:
      title - the title
      Returns:
      this builder
    • rows

      @NotNull @NotNull GuiBuilder rows(int rows)
      Sets the number of rows of the GUI.
      Parameters:
      rows - the number of rows (1 to 6)
      Returns:
      this builder
    • addLayer

      @NotNull @NotNull GuiBuilder addLayer(@NotNull @NotNull GuiLayer layer)
      Adds an already built layout layer to the GUI.
      Parameters:
      layer - the layer
      Returns:
      this builder
    • createLayer

      @NotNull @NotNull GuiBuilder createLayer(@NotNull @NotNull String id, int priority, @NotNull @NotNull Consumer<GuiLayerBuilder> configurator)
      Inline constructs and configures a layer inside the GUI builder.
      Parameters:
      id - the unique ID of the layer
      priority - the priority of the layer
      configurator - lambda consumer to configure slots in this layer
      Returns:
      this builder
    • closePolicy

      @NotNull @NotNull GuiBuilder closePolicy(@NotNull @NotNull ClosePolicy policy)
      Sets the close policy for the GUI.
      Parameters:
      policy - the close policy
      Returns:
      this builder
    • onClose

      @NotNull @NotNull GuiBuilder onClose(@NotNull Consumer<org.bukkit.entity.Player> callback)
      Sets the callback executed when the GUI is closed.
      Parameters:
      callback - the close callback
      Returns:
      this builder
    • build

      @NotNull @NotNull Gui build()
      Builds and returns the final Gui instance.
      Returns:
      the constructed Gui