Package xyz.xenondevs.invui.gui
Interface Gui.Builder<G extends Gui,S extends Gui.Builder<G,S>>
- Type Parameters:
G
- The type of theGui
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
A
Gui
builder.-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddIngredient
(char key, @NotNull Supplier<? extends Item> itemSupplier) addIngredient
(char key, @NotNull org.bukkit.inventory.ItemStack itemStack) Adds anItemStack
ingredient under the given key.addIngredient
(char key, @NotNull SlotElement element) Adds aSlotElement
ingredient under the given key.addIngredient
(char key, @NotNull Marker marker) Adds aMarker
ingredient under the given key.addIngredient
(char key, @NotNull Inventory inventory) Adds anInventory
ingredient under the given key.addIngredient
(char key, @NotNull Inventory inventory, @Nullable ItemProvider background) Adds anInventory
ingredient under the given key.addIngredient
(char key, @NotNull Item item) Adds anItem
ingredient under the given key.addIngredient
(char key, @NotNull ItemProvider itemProvider) Adds anItemProvider
ingredient under the given key.addIngredientElementSupplier
(char key, @NotNull Supplier<? extends SlotElement> elementSupplier) Adds aSupplier
ofSlotElements
ingredient under the given key.addModifier
(@NotNull Consumer<@NotNull G> modifier) Sets the background of theGui
.build()
Builds theGui
.clone()
Clones the Gui Builder.setBackground
(@NotNull org.bukkit.inventory.ItemStack itemStack) Sets the background of theGui
.setBackground
(@NotNull ItemProvider itemProvider) Sets the background of theGui
.setFrozen
(boolean frozen) Sets whether theGui
should be frozen.setIgnoreObscuredInventorySlots
(boolean ignoreObscuredInventorySlots) Sets whether it is possible to shift-click items into and cursor collect items from allInventory
slots of partially obscured embeddedInventories
.setModifiers
(@NotNull List<@NotNull Consumer<@NotNull G>> modifiers) Sets the background of theGui
.setStructure
(int width, int height, @NotNull String structureData) setStructure
(@NotNull String... structureData) setStructure
(@NotNull Structure structure)
-
Method Details
-
setStructure
- Parameters:
structure
- TheStructure
of theGui
- Returns:
- This
Gui.Builder
-
setStructure
Sets theStructure
of theGui
using the given structure data Strings. Each String is interpreted as a row of theGui
. 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) - Parameters:
width
- The width of theGui
height
- The height of theGui
structureData
- The structure data- Returns:
- This
Gui Builder
-
addIngredient
@Contract("_, _ -> this") @NotNull S addIngredient(char key, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) Adds anItemStack
ingredient under the given key.- Parameters:
key
- The keyitemStack
- TheItemStack
- Returns:
- This
Gui Builder
-
addIngredient
@Contract("_, _ -> this") @NotNull S addIngredient(char key, @NotNull @NotNull ItemProvider itemProvider) Adds anItemProvider
ingredient under the given key.- Parameters:
key
- The keyitemProvider
- TheItemProvider
- Returns:
- This
Gui Builder
-
addIngredient
Adds anItem
ingredient under the given key.- Parameters:
key
- The keyitem
- TheItem
- Returns:
- This
Gui Builder
-
addIngredient
Adds anInventory
ingredient under the given key.- Parameters:
key
- The keyinventory
- TheInventory
- Returns:
- This
Gui Builder
-
addIngredient
@Contract("_, _, _ -> this") @NotNull S addIngredient(char key, @NotNull @NotNull Inventory inventory, @Nullable @Nullable ItemProvider background) Adds anInventory
ingredient under the given key.- Parameters:
key
- The keyinventory
- TheInventory
background
- TheItemProvider
for empty slots of theInventory
- Returns:
- This
Gui Builder
-
addIngredient
Adds aSlotElement
ingredient under the given key.- Parameters:
key
- The keyelement
- TheSlotElement
- Returns:
- This
Gui Builder
-
addIngredient
Adds aMarker
ingredient under the given key.- Parameters:
key
- The keymarker
- TheMarker
- Returns:
- This
Gui Builder
-
addIngredient
@Contract("_, _ -> this") @NotNull S addIngredient(char key, @NotNull @NotNull Supplier<? extends Item> itemSupplier) - Parameters:
key
- The keyitemSupplier
- TheSupplier
ofItems
- Returns:
- This
Gui Builder
-
addIngredientElementSupplier
@Contract("_, _ -> this") @NotNull S addIngredientElementSupplier(char key, @NotNull @NotNull Supplier<? extends SlotElement> elementSupplier) Adds aSupplier
ofSlotElements
ingredient under the given key.- Parameters:
key
- The keyelementSupplier
- TheSupplier
ofSlotElements
- Returns:
- This
Gui Builder
-
setBackground
Sets the background of theGui
.- Parameters:
itemProvider
- TheItemProvider
for the background- Returns:
- This
Gui Builder
-
setBackground
@Contract("_ -> this") @NotNull S setBackground(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) Sets the background of theGui
.- Parameters:
itemStack
- TheItemStack
for the background- Returns:
- This
Gui Builder
-
setFrozen
Sets whether theGui
should be frozen.- Parameters:
frozen
- Whether theGui
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 allInventory
slots of partially obscured embeddedInventories
.- Parameters:
ignoreObscuredInventorySlots
- Whether obscuredInventory
slots should be ignored when shift-clicking and collecting to the cursor.- Returns:
- This
Gui Builder
-
addModifier
Sets the background of theGui
.- Parameters:
modifier
- TheConsumer
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 theGui
.- Parameters:
modifiers
- TheConsumers
for the background- Returns:
- This
Gui Builder
-
build
Builds theGui
.- Returns:
- The
Gui
-
clone
Clones the Gui Builder.- Returns:
- The cloned Gui Builder
-