Class BaseGuiBuilder<G extends BaseGui,B extends BaseGuiBuilder<G,B>>

java.lang.Object
dev.triumphteam.gui.builder.gui.BaseGuiBuilder<G,B>
Type Parameters:
G - The Type of BaseGui
Direct Known Subclasses:
BaseChestGuiBuilder, TypedGuiBuilder

public abstract class BaseGuiBuilder<G extends BaseGui,B extends BaseGuiBuilder<G,B>> extends Object
The base for all the GUI builders this is due to some limitations where some builders will have unique features based on the GUI type
  • Constructor Details

    • BaseGuiBuilder

      public BaseGuiBuilder()
  • Method Details

    • title

      @NotNull @Contract("_ -> this") public B title(@NotNull @NotNull net.kyori.adventure.text.Component title)
      Sets the title for the GUI This will be either a Component or a String
      Parameters:
      title - The GUI title
      Returns:
      The builder
    • disableItemPlace

      @NotNull @Contract(" -> this") public B disableItemPlace()
      Disable item placement inside the GUI
      Returns:
      The builder
      Since:
      3.0.0
    • disableItemTake

      @NotNull @Contract(" -> this") public B disableItemTake()
      Disable item retrieval inside the GUI
      Returns:
      The builder
      Since:
      3.0.0
    • disableItemSwap

      @NotNull @Contract(" -> this") public B disableItemSwap()
      Disable item swap inside the GUI
      Returns:
      The builder
      Since:
      3.0.0
    • disableItemDrop

      @NotNull @Contract(" -> this") public B disableItemDrop()
      Disable item drop inside the GUI
      Returns:
      The builder
      Since:
      3.0.3
    • disableOtherActions

      @NotNull @Contract(" -> this") public B disableOtherActions()
      Disable other GUI actions This option pretty much disables creating a clone stack of the item
      Returns:
      The builder
      Since:
      3.0.4
    • disableAllInteractions

      @NotNull @Contract(" -> this") public B disableAllInteractions()
      Disable all the modifications of the GUI, making it immutable by player interaction
      Returns:
      The builder
      Since:
      3.0.0
    • enableItemPlace

      @NotNull @Contract(" -> this") public B enableItemPlace()
      Allows item placement inside the GUI
      Returns:
      The builder
      Since:
      3.0.0
    • enableItemTake

      @NotNull @Contract(" -> this") public B enableItemTake()
      Allow items to be taken from the GUI
      Returns:
      The builder
      Since:
      3.0.0
    • enableItemSwap

      @NotNull @Contract(" -> this") public B enableItemSwap()
      Allows item swap inside the GUI
      Returns:
      The builder
      Since:
      3.0.0
    • enableItemDrop

      @NotNull @Contract(" -> this") public B enableItemDrop()
      Allows item drop inside the GUI
      Returns:
      The builder
      Since:
      3.0.3
    • enableOtherActions

      @NotNull @Contract(" -> this") public B enableOtherActions()
      Enable other GUI actions This option pretty much enables creating a clone stack of the item
      Returns:
      The builder
      Since:
      3.0.4
    • enableAllInteractions

      @NotNull @Contract(" -> this") public B enableAllInteractions()
      Enable all modifications of the GUI, making it completely mutable by player interaction
      Returns:
      The builder
      Since:
      3.0.0
    • apply

      @NotNull @Contract("_ -> this") public B apply(@NotNull @NotNull Consumer<G> consumer)
      Applies anything to the GUI once it's created Can be pretty useful for setting up small things like default actions
      Parameters:
      consumer - A Consumer that passes the built GUI
      Returns:
      The builder
    • create

      @NotNull @Contract(" -> new") public abstract G create()
      Creates the given GuiBase Has to be abstract because each GUI are different
      Returns:
      The new BaseGui
    • getTitle

      @NotNull protected @NotNull net.kyori.adventure.text.Component getTitle()
      Getter for the title
      Returns:
      The current title
    • getConsumer

      @Nullable protected @Nullable Consumer<G> getConsumer()
      Getter for the consumer
      Returns:
      The consumer
    • getModifiers

      @NotNull protected @NotNull Set<InteractionModifier> getModifiers()
      Getter for the set of interaction modifiers
      Returns:
      The set of InteractionModifier
      Since:
      3.0.0
    • consumeBuilder

      protected void consumeBuilder(@NotNull @NotNull BaseGuiBuilder<?,?> builder)