Class InventoryManager
java.lang.Object
studio.magemonkey.codex.mccore.items.InventoryManager
Manages creating inventories and checking if the inventory is
for a particular purpose using keys attached to the inventory holder.
An example usage of this would be a custom shop inventory where
functionality is attached to that specific inventory. Creating the
inventory with a key, then checking on events for the matching key
lets you easily apply functionality to only the shop inventories.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.inventory.InventorycreateInventory(String key, int rows, String title) Creates a new inventory marked with the given keystatic booleanisMatching(org.bukkit.inventory.Inventory inventory, String key) Checks whether the given inventory matches the given key
-
Constructor Details
-
InventoryManager
public InventoryManager()
-
-
Method Details
-
createInventory
Creates a new inventory marked with the given key- Parameters:
key- key to mark the inventory withrows- number of rows in the inventorytitle- title for the inventory- Returns:
- the created inventory
-
isMatching
Checks whether the given inventory matches the given key- Parameters:
inventory- inventory to checkkey- key to check against- Returns:
- true if matches, false otherwise
-