-
New Feature
-
Resolution: Unresolved
-
Minor
-
None
-
None
-
This server is running CraftBukkit version git-Spigot-1a3504a-a46fdbc (MC: 1.13.2) (Implementing API version 1.13.2-R0.1-SNAPSHOT)
-
Yes
This is rather a convenience method, but I thought that a bidirectional mapping of Material and InventoryType could make some code easier. Also, this would allow for easily getting all materials that will open an Inventory when clicked on, which is helpful because manually adding all these Materials is a pain with all the different colors of shulker boxes.
I.e. create a method
Material#getOpenedInventoryType()
to get the opened InventoryType, e.g.
Material.ANVIL.getOpenedInventoryType() == InventoryType.ANVIL
as well as InventoryType#getMaterialToOpen() which does the same in the other direction.
One should probably note in the Javadoc that calling both methods might not return the initial input, e.g.:
Material.TRAPPED_CHEST.getOpenedInventoryType().getMaterialToOpen() == Material.CHEST
because there is no dedicated InventoryType for trapped chests.