Package dev.cwhead.GravesX.api.inventory
Class InventoryAPI
java.lang.Object
dev.cwhead.GravesX.api.inventory.InventoryAPI
Inventory helper API.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
equipArmor
(@NotNull org.bukkit.inventory.Inventory inventory, @NotNull org.bukkit.entity.Player player) Equips the player's armor from the given inventory.void
equipItems
(@NotNull org.bukkit.inventory.Inventory inventory, @NotNull org.bukkit.entity.Player player) Equips the player's inventory items from the given inventory.int
getInventorySize
(int size) Gets the appropriate inventory size based on the given size.inventoryToString
(@NotNull org.bukkit.inventory.Inventory inventory) Converts the given inventory to a string representation.org.bukkit.inventory.Inventory
stringToInventory
(@NotNull org.bukkit.inventory.InventoryHolder inventoryHolder, @NotNull String string, @NotNull String title) Converts a string representation of an inventory to an Inventory object.
-
Constructor Details
-
InventoryAPI
-
-
Method Details
-
getInventorySize
public int getInventorySize(int size) Gets the appropriate inventory size based on the given size.- Parameters:
size
- The size to be used for determining the inventory size.- Returns:
- The appropriate inventory size.
-
equipArmor
public void equipArmor(@NotNull @NotNull org.bukkit.inventory.Inventory inventory, @NotNull @NotNull org.bukkit.entity.Player player) Equips the player's armor from the given inventory.- Parameters:
inventory
- The inventory containing the armor items.player
- The player to be equipped with armor.
-
equipItems
public void equipItems(@NotNull @NotNull org.bukkit.inventory.Inventory inventory, @NotNull @NotNull org.bukkit.entity.Player player) Equips the player's inventory items from the given inventory.- Parameters:
inventory
- The inventory containing the items.player
- The player to be equipped with items.
-
inventoryToString
Converts the given inventory to a string representation.- Parameters:
inventory
- The inventory to be converted.- Returns:
- The string representation of the inventory.
-
stringToInventory
public org.bukkit.inventory.Inventory stringToInventory(@NotNull @NotNull org.bukkit.inventory.InventoryHolder inventoryHolder, @NotNull @NotNull String string, @NotNull @NotNull String title) Converts a string representation of an inventory to an Inventory object.- Parameters:
inventoryHolder
- The inventory holder.string
- The string representation of the inventory.title
- The title of the inventory.- Returns:
- The Inventory object.
-