SPIGOT-7620: Fix server crash when hoppers transfer items to double chests

This commit is contained in:
2008Choco 2024-04-24 11:19:05 +10:00 committed by md_5
parent 8b4abeb03a
commit ff20043879
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -78,7 +78,7 @@
+ destinationInventory = new CraftInventory(iinventory);
+ }
+
+ InventoryMoveItemEvent event = new InventoryMoveItemEvent(iinventory.getOwner().getInventory(), oitemstack, destinationInventory, true);
+ InventoryMoveItemEvent event = new InventoryMoveItemEvent(tileentityhopper.getOwner().getInventory(), oitemstack, destinationInventory, true);
+ world.getCraftServer().getPluginManager().callEvent(event);
+ if (event.isCancelled()) {
+ tileentityhopper.setItem(i, itemstack);