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:
PaginatedBuilder, ScrollingBuilder, SimpleBuilder, StorageBuilder

public abstract class BaseGuiBuilder<G extends BaseGui,​B extends BaseGuiBuilder<G,​B>>
extends java.lang.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 Summary

    Constructors 
    Constructor Description
    BaseGuiBuilder()  
  • Method Summary

    Modifier and Type Method Description
    B apply​(@NotNull java.util.function.Consumer<G> consumer)
    Applies anything to the GUI once it's created Can be pretty useful for setting up small things like default actions
    abstract G create()
    Creates the given GuiBase Has to be abstract because each GUI are different
    B disableAllInteractions()
    Disable all the modifications of the GUI, making it immutable by player interaction
    B disableItemPlace()
    Disable item placement inside the GUI
    B disableItemSwap()
    Disable item swap inside the GUI
    B disableItemTake()
    Disable item retrieval inside the GUI
    B enableAllInteractions()
    Enable all modifications of the GUI, making it completely mutable by player interaction
    B enableItemPlace()
    Allows item placement inside the GUI
    B enableItemSwap()
    Allows item swap inside the GUI
    B enableItemTake()
    Allow items to be taken from the GUI
    B rows​(int rows)
    Sets the rows for the GUI This will only work on CHEST GuiType
    B title​(@NotNull net.kyori.adventure.text.Component title)
    Sets the title for the GUI This will be either a Component or a String

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • rows

      @Contract("_ -> this") public B rows​(int rows)
      Sets the rows for the GUI This will only work on CHEST GuiType
      Parameters:
      rows - The amount of rows
      Returns:
      The builder
    • title

      @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

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

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

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

      @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

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

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

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

      @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

      @Contract("_ -> this") public B apply​(@NotNull @NotNull java.util.function.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

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