Class Structure
java.lang.Object
xyz.xenondevs.invui.gui.structure.Structure
- All Implemented Interfaces:
Cloneable
Provides an easy way to design
Guis.
Inspired by Bukkit's ShapedRecipe, Structures will let you
design a Gui in a similar way.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddGlobalIngredient(char key, @NotNull Supplier<? extends Item> itemSupplier) static voidaddGlobalIngredient(char key, @NotNull org.bukkit.inventory.ItemStack itemStack) Adds a globalItemStackingredient under the given key.static voidaddGlobalIngredient(char key, @NotNull SlotElement element) Adds a globalSlotElementingredient under the given key.static voidaddGlobalIngredient(char key, @NotNull Marker marker) Adds a globalMarkeringredient under the given key.static voidaddGlobalIngredient(char key, @NotNull Item item) Adds a globalItemingredient under the given key.static voidaddGlobalIngredient(char key, @NotNull ItemProvider itemProvider) Adds a globalItemProvideringredient under the given key.static voidaddGlobalIngredientElementSupplier(char key, @NotNull Supplier<? extends SlotElement> elementSupplier) Adds a globalSlotElementSupplieringredient under the given key.@NotNull StructureaddIngredient(char key, @NotNull Supplier<? extends Item> itemSupplier) Adds anItemStackSupplieringredient under the given key.@NotNull StructureaddIngredient(char key, @NotNull org.bukkit.inventory.ItemStack itemStack) Adds anItemStackingredient under the given key.@NotNull StructureaddIngredient(char key, @NotNull SlotElement element) Adds aInventoryingredient under the given key.@NotNull StructureaddIngredient(char key, @NotNull Marker marker) Adds aMarkeringredient under the given key.@NotNull StructureaddIngredient(char key, @NotNull Inventory inventory) Adds aInventoryingredient under the given key.@NotNull StructureaddIngredient(char key, @NotNull Inventory inventory, @Nullable ItemProvider background) Adds aInventoryingredient under the given key.@NotNull StructureaddIngredient(char key, @NotNull Item item) Adds anItemingredient under the given key.@NotNull StructureaddIngredient(char key, @NotNull ItemProvider itemProvider) Adds anItemProvideringredient under the given key.@NotNull StructureaddIngredientElementSupplier(char key, @NotNull Supplier<? extends SlotElement> elementSupplier) Adds aSlotElementSupplieringredient under the given key.@NotNull Structureclone()Clones thisStructure.intGets the height of thisStructure.@NotNull IngredientListGets theIngredientListfor thisStructure.intgetWidth()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 globalItemStackingredient under the given key. Global ingredients will be used for allStructureswhich do not have an ingredient defined for that key.- Parameters:
key- The key of the ingredientitemStack- TheItemStackingredient
-
addGlobalIngredient
Adds a globalItemProvideringredient under the given key. Global ingredients will be used for allStructureswhich do not have an ingredient defined for that key.- Parameters:
key- The key of the ingredientitemProvider- TheItemProvideringredient
-
addGlobalIngredient
Adds a globalItemingredient under the given key. Global ingredients will be used for allStructureswhich do not have an ingredient defined for that key.- Parameters:
key- The key of the ingredientitem- TheItemingredient
-
addGlobalIngredient
public static void addGlobalIngredient(char key, @NotNull @NotNull Supplier<? extends Item> itemSupplier) Adds a globalItemSupplieringredient under the given key. Global ingredients will be used for allStructureswhich do not have an ingredient defined for that key. -
addGlobalIngredient
Adds a globalSlotElementingredient under the given key. Global ingredients will be used for allStructureswhich do not have an ingredient defined for that key.- Parameters:
key- The key of the ingredientelement- TheSlotElementingredient
-
addGlobalIngredient
Adds a globalMarkeringredient under the given key. Global ingredients will be used for allStructureswhich do not have an ingredient defined for that key.- Parameters:
key- The key of the ingredientmarker- TheMarkeringredient
-
addGlobalIngredientElementSupplier
public static void addGlobalIngredientElementSupplier(char key, @NotNull @NotNull Supplier<? extends SlotElement> elementSupplier) Adds a globalSlotElementSupplieringredient under the given key. Global ingredients will be used for allStructureswhich do not have an ingredient defined for that key.- Parameters:
key- The key of the ingredientelementSupplier- TheSlotElementSupplieringredient
-
addIngredient
@Contract("_, _ -> this") @NotNull public @NotNull Structure addIngredient(char key, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) Adds anItemStackingredient under the given key.- Parameters:
key- The key of the ingredientitemStack- TheItemStackingredient- Returns:
- This
Structure
-
addIngredient
@Contract("_, _ -> this") @NotNull public @NotNull Structure addIngredient(char key, @NotNull @NotNull ItemProvider itemProvider) Adds anItemProvideringredient under the given key.- Parameters:
key- The key of the ingredientitemProvider- TheItemProvideringredient- Returns:
- This
Structure
-
addIngredient
@Contract("_, _ -> this") @NotNull public @NotNull Structure addIngredient(char key, @NotNull @NotNull Item item) Adds anItemingredient under the given key. -
addIngredient
@Contract("_, _ -> this") @NotNull public @NotNull Structure addIngredient(char key, @NotNull @NotNull Inventory inventory) Adds aInventoryingredient under the given key. -
addIngredient
@Contract("_, _, _ -> this") @NotNull public @NotNull Structure addIngredient(char key, @NotNull @NotNull Inventory inventory, @Nullable @Nullable ItemProvider background) Adds aInventoryingredient under the given key.- Parameters:
key- The key of the ingredientinventory- TheInventoryingredientbackground- The backgroundItemProviderfor theInventory- Returns:
- This
Structure
-
addIngredient
@Contract("_, _ -> this") @NotNull public @NotNull Structure addIngredient(char key, @NotNull @NotNull SlotElement element) Adds aInventoryingredient under the given key.- Parameters:
key- The key of the ingredientelement- TheSlotElementingredient- Returns:
- This
Structure
-
addIngredient
@Contract("_, _ -> this") @NotNull public @NotNull Structure addIngredient(char key, @NotNull @NotNull Marker marker) Adds aMarkeringredient under the given key. -
addIngredient
@Contract("_, _ -> this") @NotNull public @NotNull Structure addIngredient(char key, @NotNull @NotNull Supplier<? extends Item> itemSupplier) Adds anItemStackSupplieringredient under the given key. -
addIngredientElementSupplier
@Contract("_, _ -> this") @NotNull public @NotNull Structure addIngredientElementSupplier(char key, @NotNull @NotNull Supplier<? extends SlotElement> elementSupplier) Adds aSlotElementSupplieringredient under the given key.- Parameters:
key- The key of the ingredientelementSupplier- TheSlotElementSupplieringredient- Returns:
- This
Structure
-
getIngredientList
Gets theIngredientListfor thisStructure. Calling this method will lock theStructureand 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.
-