-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
None
CraftInventory#getLocation calls IInventory#getLocation, which is not implemented for EntityMinecartContainer.
@EventHandler(ignoreCancelled = true) public void onInventoryOpen(InventoryOpenEvent event) { Inventory inv = event.getInventory(); Location location; try { location = inv.getLocation(); } catch (AbstractMethodError e) { System.err.println(new StringBuilder("Caught AbstractMethodError calling Inventory#getLocation on class ") .append(inv.getClass().getName()) .append("\nType: ").append(inv.getType()) .append("\nTitle: ").append(inv.getTitle()) .append("\nHolder: ").append(inv.getHolder())); return; } }
Output:
[Server thread/WARN]: Caught AbstractMethodError calling Inventory#getLocation on class org.bukkit.craftbukkit.v1_9_R1.inventory.CraftInventory
Type: CHEST
Title: Minecart with Chest
Holder: CraftMinecartChest{inventory=org.bukkit.craftbukkit.v1_9_R1.inventory.CraftInventory@22eb6}