Interface Gui.Builder<G extends Gui,S extends Gui.Builder<G,S>>

Type Parameters:
G - The type of the Gui
S - The type of the builder
All Superinterfaces:
Cloneable
All Known Subinterfaces:
Gui.Builder.Normal, PagedGui.Builder<C>, ScrollGui.Builder<C>, TabGui.Builder
All Known Implementing Classes:
AbstractGui.AbstractBuilder, AbstractPagedGui.AbstractBuilder, AbstractScrollGui.AbstractBuilder, AbstractTabGui.AbstractBuilder
Enclosing interface:
Gui

public static interface Gui.Builder<G extends Gui,S extends Gui.Builder<G,S>> extends Cloneable
A Gui builder.
  • Method Details

    • setStructure

      @Contract("_ -> this") @NotNull S setStructure(@NotNull @NotNull Structure structure)
      Sets the Structure of the Gui.
      Parameters:
      structure - The Structure of the Gui
      Returns:
      This Gui.Builder
    • setStructure

      @Contract("_ -> this") @NotNull S setStructure(@NotNull @NotNull String... structureData)
      Sets the Structure of the Gui using the given structure data Strings. Each String is interpreted as a row of the Gui. All Strings must have the same length.
      Parameters:
      structureData - The structure data
      Returns:
      This Gui Builder
    • setStructure

      @Contract("_, _, _, -> this") @NotNull S setStructure(int width, int height, @NotNull @NotNull String structureData)
      Sets the Structure of the Gui using the given structure data, width and height.
      Parameters:
      width - The width of the Gui
      height - The height of the Gui
      structureData - The structure data
      Returns:
      This Gui Builder
    • addIngredient

      @Contract("_, _ -> this") @NotNull S addIngredient(char key, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
      Adds an ItemStack ingredient under the given key.
      Parameters:
      key - The key
      itemStack - The ItemStack
      Returns:
      This Gui Builder
    • addIngredient

      @Contract("_, _ -> this") @NotNull S addIngredient(char key, @NotNull @NotNull ItemProvider itemProvider)
      Adds an ItemProvider ingredient under the given key.
      Parameters:
      key - The key
      itemProvider - The ItemProvider
      Returns:
      This Gui Builder
    • addIngredient

      @Contract("_, _ -> this") @NotNull S addIngredient(char key, @NotNull @NotNull Item item)
      Adds an Item ingredient under the given key.
      Parameters:
      key - The key
      item - The Item
      Returns:
      This Gui Builder
    • addIngredient

      @Contract("_, _ -> this") @NotNull S addIngredient(char key, @NotNull @NotNull Inventory inventory)
      Adds an Inventory ingredient under the given key.
      Parameters:
      key - The key
      inventory - The Inventory
      Returns:
      This Gui Builder
    • addIngredient

      @Contract("_, _, _ -> this") @NotNull S addIngredient(char key, @NotNull @NotNull Inventory inventory, @Nullable @Nullable ItemProvider background)
      Adds an Inventory ingredient under the given key.
      Parameters:
      key - The key
      inventory - The Inventory
      background - The ItemProvider for empty slots of the Inventory
      Returns:
      This Gui Builder
    • addIngredient

      @Contract("_, _ -> this") @NotNull S addIngredient(char key, @NotNull @NotNull SlotElement element)
      Adds a SlotElement ingredient under the given key.
      Parameters:
      key - The key
      element - The SlotElement
      Returns:
      This Gui Builder
    • addIngredient

      @Contract("_, _ -> this") @NotNull S addIngredient(char key, @NotNull @NotNull Marker marker)
      Adds a Marker ingredient under the given key.
      Parameters:
      key - The key
      marker - The Marker
      Returns:
      This Gui Builder
    • addIngredient

      @Contract("_, _ -> this") @NotNull S addIngredient(char key, @NotNull @NotNull Supplier<? extends Item> itemSupplier)
      Adds a Supplier of Items ingredient under the given key.
      Parameters:
      key - The key
      itemSupplier - The Supplier of Items
      Returns:
      This Gui Builder
    • addIngredientElementSupplier

      @Contract("_, _ -> this") @NotNull S addIngredientElementSupplier(char key, @NotNull @NotNull Supplier<? extends SlotElement> elementSupplier)
      Adds a Supplier of SlotElements ingredient under the given key.
      Parameters:
      key - The key
      elementSupplier - The Supplier of SlotElements
      Returns:
      This Gui Builder
    • setBackground

      @Contract("_ -> this") @NotNull S setBackground(@NotNull @NotNull ItemProvider itemProvider)
      Sets the background of the Gui.
      Parameters:
      itemProvider - The ItemProvider for the background
      Returns:
      This Gui Builder
    • setBackground

      @Contract("_ -> this") @NotNull S setBackground(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
      Sets the background of the Gui.
      Parameters:
      itemStack - The ItemStack for the background
      Returns:
      This Gui Builder
    • setFrozen

      @Contract("_ -> this") @NotNull S setFrozen(boolean frozen)
      Sets whether the Gui should be frozen.
      Parameters:
      frozen - Whether the Gui should be frozen
      Returns:
      This Gui Builder
    • setIgnoreObscuredInventorySlots

      @Contract("_ -> this") @NotNull S setIgnoreObscuredInventorySlots(boolean ignoreObscuredInventorySlots)
      Sets whether it is possible to shift-click items into and cursor collect items from all Inventory slots of partially obscured embedded Inventories.
      Parameters:
      ignoreObscuredInventorySlots - Whether obscured Inventory slots should be ignored when shift-clicking and collecting to the cursor.
      Returns:
      This Gui Builder
    • addModifier

      @Contract("_ -> this") @NotNull S addModifier(@NotNull @NotNull Consumer<@NotNull G> modifier)
      Sets the background of the Gui.
      Parameters:
      modifier - The Consumer for the background
      Returns:
      This Gui Builder
    • setModifiers

      @Contract("_ -> this") @NotNull S setModifiers(@NotNull @NotNull List<@NotNull Consumer<@NotNull G>> modifiers)
      Sets the background of the Gui.
      Parameters:
      modifiers - The Consumers for the background
      Returns:
      This Gui Builder
    • build

      @Contract("-> new") @NotNull G build()
      Builds the Gui.
      Returns:
      The Gui
    • clone

      @Contract("-> new") @NotNull S clone()
      Clones the Gui Builder.
      Returns:
      The cloned Gui Builder