Package dev.triumphteam.gui.builder.gui
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 ofBaseGui
- Direct Known Subclasses:
PaginatedBuilder,ScrollingBuilder,SimpleBuilder,StorageBuilder
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionApplies anything to the GUI once it's created Can be pretty useful for setting up small things like default actionsabstract Gcreate()Creates the given GuiBase Has to be abstract because each GUI are differentDisable all the modifications of the GUI, making it immutable by player interactionDisable item drop inside the GUIDisable item placement inside the GUIDisable item swap inside the GUIDisable item retrieval inside the GUIDisable other GUI actions This option pretty much disables creating a clone stack of the itemEnable all modifications of the GUI, making it completely mutable by player interactionAllows item drop inside the GUIAllows item placement inside the GUIAllows item swap inside the GUIAllow items to be taken from the GUIEnable other GUI actions This option pretty much enables creating a clone stack of the itemGetter for the consumerprotected @NotNull Set<InteractionModifier>Getter for the set of interaction modifiersprotected intgetRows()Getter for the rowsprotected @NotNull net.kyori.adventure.text.ComponentgetTitle()Getter for the titlerows(int rows) Sets the rows for the GUI This will only work on CHESTGuiTypetitle(@NotNull net.kyori.adventure.text.Component title) Sets the title for the GUI This will be either a Component or a String
-
Constructor Details
-
BaseGuiBuilder
public BaseGuiBuilder()
-
-
Method Details
-
rows
Sets the rows for the GUI This will only work on CHESTGuiType- Parameters:
rows- The amount of rows- Returns:
- The builder
-
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
Disable item placement inside the GUI- Returns:
- The builder
- Since:
- 3.0.0
-
disableItemTake
Disable item retrieval inside the GUI- Returns:
- The builder
- Since:
- 3.0.0
-
disableItemSwap
Disable item swap inside the GUI- Returns:
- The builder
- Since:
- 3.0.0
-
disableItemDrop
Disable item drop inside the GUI- Returns:
- The builder
- Since:
- 3.0.3
-
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
Disable all the modifications of the GUI, making it immutable by player interaction- Returns:
- The builder
- Since:
- 3.0.0
-
enableItemPlace
Allows item placement inside the GUI- Returns:
- The builder
- Since:
- 3.0.0
-
enableItemTake
Allow items to be taken from the GUI- Returns:
- The builder
- Since:
- 3.0.0
-
enableItemSwap
Allows item swap inside the GUI- Returns:
- The builder
- Since:
- 3.0.0
-
enableItemDrop
Allows item drop inside the GUI- Returns:
- The builder
- Since:
- 3.0.3
-
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
Enable all modifications of the GUI, making it completely mutable by player interaction- Returns:
- The builder
- Since:
- 3.0.0
-
apply
Applies anything to the GUI once it's created Can be pretty useful for setting up small things like default actions- Parameters:
consumer- AConsumerthat passes the built GUI- Returns:
- The builder
-
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
-
getRows
protected int getRows()Getter for the rows- Returns:
- The amount of rows
-
getConsumer
Getter for the consumer- Returns:
- The consumer
-
getModifiers
Getter for the set of interaction modifiers- Returns:
- The set of
InteractionModifier - Since:
- 3.0.0
-