5. Inventory Openers
Last updated
Last updated
InventoryOpener
is an interface used by SmartInvs to open the inventories. When an inventory is trying to be opened for a player, the InventoryManager
will try to find an InventoryOpener
that supports the InventoryType
of the inventory, if no opener is found, the inventory will not be opened and an exception will be thrown.
This is the list of the InventoryOpeners currently supported by SmartInvs:
If the inventory type you need to open is not supported by default, you can define your own support by creating a new Inventory Opener, to do this, you need to implement the InventoryOpener
interface, like this:
(The InventoryType.CUSTOM and the Bukkit.createCustomInventory methods don't exist, it's just for the example)
Then, when your InventoryOpener
is done, register it using:
And it's all, now SmartInvs will handle all the other things for you!
Name
Supported Types
ChestInventoryOpener
CHEST
, ENDER_CHEST
SpecialInventoryOpener
FURNACE
, WORKBENCH
, DISPENSER
, DROPPER
,
ENCHANTING
, BREWING
, ANVIL
, BEACON
, HOPPER