-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Minor
-
None
-
Affects Version/s: None
-
None
-
This server is running CraftBukkit version 4542-Spigot-6e369ba-59f1b90 (MC: 1.21.10) (Implementing API version 1.21.10-R0.1-SNAPSHOT)
-
Yes
public static Inventory getInventory(Block containerBlock) { BlockState state = containerBlock.getState(); assert state instanceof Container; Container container = (Container) state; // Note: For double chests this returns the complete double chest inventory. Log.debug("Container type: " + container.getClass().getName() + " Inventory type: " + container.getInventory().getClass().getName() + " Inventory size: " + container.getInventory().getSize()); return container.getInventory(); // Not null }
For double chests and double trap chests, this returns the expected double chest inventory. However, for double copper chests added in 1.21.9, this only returns the inventory of the particular block.
Debug log output for normal double chests:
Container type: org.bukkit.craftbukkit.v1_21_R6.block.CraftChest Inventory type: org.bukkit.craftbukkit.v1_21_R6.inventory.CraftInventoryDoubleChest Inventory size: 54
Output for copper chests:
Container type: org.bukkit.craftbukkit.v1_21_R6.block.CraftChest Inventory type: org.bukkit.craftbukkit.v1_21_R6.inventory.CraftInventory Inventory size: 27