Add support for custom Hopper inventories. Fixes BUKKIT-4722
Opening a hopper inventory created by Server.createInventory will currently have no effect as proper handling code is missing in CraftEntityHuman for hopper inventories that aren't associated with a tile entity or minecart. Initialization logic for hoppers is also missing from CraftContainer, which is necessary for the opening of custom hopper inventories. This commit fixes the two aforementioned by adding proper handling to CraftHumanEntity for opening inventories not associated with a tile entity, and by adding initialization logic for hoppers to CraftContainer. By: FrozenBrain <carstenbamsti@googlemail.com>
This commit is contained in:
@@ -224,6 +224,8 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
getHandle().openHopper((TileEntityHopper) craftinv.getInventory());
|
||||
} else if (craftinv.getInventory() instanceof EntityMinecartHopper) {
|
||||
getHandle().openMinecartHopper((EntityMinecartHopper) craftinv.getInventory());
|
||||
} else {
|
||||
openCustomInventory(inventory, player, 9);
|
||||
}
|
||||
break;
|
||||
case CREATIVE:
|
||||
|
||||
Reference in New Issue
Block a user