Class Structure
java.lang.Object
xyz.xenondevs.invui.gui.structure.Structure
- All Implemented Interfaces:
Cloneable
Provides an easy way to design
Gui
s.
Inspired by Bukkit's ShapedRecipe
, Structures
will let you
design a Gui
in a similar way.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addGlobalIngredient
(char key, @NotNull Supplier<? extends Item> itemSupplier) static void
addGlobalIngredient
(char key, @NotNull org.bukkit.inventory.ItemStack itemStack) Adds a globalItemStack
ingredient under the given key.static void
addGlobalIngredient
(char key, @NotNull SlotElement element) Adds a globalSlotElement
ingredient under the given key.static void
addGlobalIngredient
(char key, @NotNull Marker marker) Adds a globalMarker
ingredient under the given key.static void
addGlobalIngredient
(char key, @NotNull Item item) Adds a globalItem
ingredient under the given key.static void
addGlobalIngredient
(char key, @NotNull ItemProvider itemProvider) Adds a globalItemProvider
ingredient under the given key.static void
addGlobalIngredientElementSupplier
(char key, @NotNull Supplier<? extends SlotElement> elementSupplier) Adds a globalSlotElement
Supplier
ingredient under the given key.@NotNull Structure
addIngredient
(char key, @NotNull Supplier<? extends Item> itemSupplier) Adds anItemStack
Supplier
ingredient under the given key.@NotNull Structure
addIngredient
(char key, @NotNull org.bukkit.inventory.ItemStack itemStack) Adds anItemStack
ingredient under the given key.@NotNull Structure
addIngredient
(char key, @NotNull SlotElement element) Adds aInventory
ingredient under the given key.@NotNull Structure
addIngredient
(char key, @NotNull Marker marker) Adds aMarker
ingredient under the given key.@NotNull Structure
addIngredient
(char key, @NotNull Inventory inventory) Adds aInventory
ingredient under the given key.@NotNull Structure
addIngredient
(char key, @NotNull Inventory inventory, @Nullable ItemProvider background) Adds aInventory
ingredient under the given key.@NotNull Structure
addIngredient
(char key, @NotNull Item item) Adds anItem
ingredient under the given key.@NotNull Structure
addIngredient
(char key, @NotNull ItemProvider itemProvider) Adds anItemProvider
ingredient under the given key.@NotNull Structure
addIngredientElementSupplier
(char key, @NotNull Supplier<? extends SlotElement> elementSupplier) Adds aSlotElement
Supplier
ingredient under the given key.@NotNull Structure
clone()
Clones thisStructure
.int
Gets the height of thisStructure
.@NotNull IngredientList
Gets theIngredientList
for thisStructure
.int
getWidth()
Gets the width of thisStructure
.
-
Constructor Details
-
Method Details
-
addGlobalIngredient
public static void addGlobalIngredient(char key, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) Adds a globalItemStack
ingredient under the given key. Global ingredients will be used for allStructures
which do not have an ingredient defined for that key.- Parameters:
key
- The key of the ingredientitemStack
- TheItemStack
ingredient
-
addGlobalIngredient
Adds a globalItemProvider
ingredient under the given key. Global ingredients will be used for allStructures
which do not have an ingredient defined for that key.- Parameters:
key
- The key of the ingredientitemProvider
- TheItemProvider
ingredient
-
addGlobalIngredient
Adds a globalItem
ingredient under the given key. Global ingredients will be used for allStructures
which do not have an ingredient defined for that key.- Parameters:
key
- The key of the ingredientitem
- TheItem
ingredient
-
addGlobalIngredient
public static void addGlobalIngredient(char key, @NotNull @NotNull Supplier<? extends Item> itemSupplier) Adds a globalItem
Supplier
ingredient under the given key. Global ingredients will be used for allStructures
which do not have an ingredient defined for that key. -
addGlobalIngredient
Adds a globalSlotElement
ingredient under the given key. Global ingredients will be used for allStructures
which do not have an ingredient defined for that key.- Parameters:
key
- The key of the ingredientelement
- TheSlotElement
ingredient
-
addGlobalIngredient
Adds a globalMarker
ingredient under the given key. Global ingredients will be used for allStructures
which do not have an ingredient defined for that key.- Parameters:
key
- The key of the ingredientmarker
- TheMarker
ingredient
-
addGlobalIngredientElementSupplier
public static void addGlobalIngredientElementSupplier(char key, @NotNull @NotNull Supplier<? extends SlotElement> elementSupplier) Adds a globalSlotElement
Supplier
ingredient under the given key. Global ingredients will be used for allStructures
which do not have an ingredient defined for that key.- Parameters:
key
- The key of the ingredientelementSupplier
- TheSlotElement
Supplier
ingredient
-
addIngredient
@Contract("_, _ -> this") @NotNull public @NotNull Structure addIngredient(char key, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) Adds anItemStack
ingredient under the given key.- Parameters:
key
- The key of the ingredientitemStack
- TheItemStack
ingredient- Returns:
- This
Structure
-
addIngredient
@Contract("_, _ -> this") @NotNull public @NotNull Structure addIngredient(char key, @NotNull @NotNull ItemProvider itemProvider) Adds anItemProvider
ingredient under the given key.- Parameters:
key
- The key of the ingredientitemProvider
- TheItemProvider
ingredient- Returns:
- This
Structure
-
addIngredient
@Contract("_, _ -> this") @NotNull public @NotNull Structure addIngredient(char key, @NotNull @NotNull Item item) Adds anItem
ingredient under the given key. -
addIngredient
@Contract("_, _ -> this") @NotNull public @NotNull Structure addIngredient(char key, @NotNull @NotNull Inventory inventory) Adds aInventory
ingredient under the given key. -
addIngredient
@Contract("_, _, _ -> this") @NotNull public @NotNull Structure addIngredient(char key, @NotNull @NotNull Inventory inventory, @Nullable @Nullable ItemProvider background) Adds aInventory
ingredient under the given key.- Parameters:
key
- The key of the ingredientinventory
- TheInventory
ingredientbackground
- The backgroundItemProvider
for theInventory
- Returns:
- This
Structure
-
addIngredient
@Contract("_, _ -> this") @NotNull public @NotNull Structure addIngredient(char key, @NotNull @NotNull SlotElement element) Adds aInventory
ingredient under the given key.- Parameters:
key
- The key of the ingredientelement
- TheSlotElement
ingredient- Returns:
- This
Structure
-
addIngredient
@Contract("_, _ -> this") @NotNull public @NotNull Structure addIngredient(char key, @NotNull @NotNull Marker marker) Adds aMarker
ingredient under the given key. -
addIngredient
@Contract("_, _ -> this") @NotNull public @NotNull Structure addIngredient(char key, @NotNull @NotNull Supplier<? extends Item> itemSupplier) Adds anItemStack
Supplier
ingredient under the given key. -
addIngredientElementSupplier
@Contract("_, _ -> this") @NotNull public @NotNull Structure addIngredientElementSupplier(char key, @NotNull @NotNull Supplier<? extends SlotElement> elementSupplier) Adds aSlotElement
Supplier
ingredient under the given key.- Parameters:
key
- The key of the ingredientelementSupplier
- TheSlotElement
Supplier
ingredient- Returns:
- This
Structure
-
getIngredientList
Gets theIngredientList
for thisStructure
. Calling this method will lock theStructure
and prevent further changes.- Returns:
- The
IngredientList
-
getWidth
public int getWidth()Gets the width of thisStructure
.- Returns:
- The width
-
getHeight
public int getHeight()Gets the height of thisStructure
.- Returns:
- The height
-
clone
Clones thisStructure
.
-