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 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 actionsabstract G
create()
Creates the given GuiBase Has to be abstract because each GUI are differentB
disableAllInteractions()
Disable all the modifications of the GUI, making it immutable by player interactionB
disableItemPlace()
Disable item placement inside the GUIB
disableItemSwap()
Disable item swap inside the GUIB
disableItemTake()
Disable item retrieval inside the GUIB
enableAllInteractions()
Enable all modifications of the GUI, making it completely mutable by player interactionB
enableItemPlace()
Allows item placement inside the GUIB
enableItemSwap()
Allows item swap inside the GUIB
enableItemTake()
Allow items to be taken from the GUIB
rows(int rows)
Sets the rows for the GUI This will only work on CHESTGuiType
B
title(@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
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
-
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
-
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
- AConsumer
that 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
-