mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-12 09:51:12 +01:00
SPIGOT-4835: Manually opened chest doesn't have close animation
This commit is contained in:
parent
84c2f4d1ab
commit
09a453aede
1 changed files with 28 additions and 24 deletions
|
@ -334,31 +334,35 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||||
case PLAYER:
|
case PLAYER:
|
||||||
case CHEST:
|
case CHEST:
|
||||||
case ENDER_CHEST:
|
case ENDER_CHEST:
|
||||||
Containers customSize;
|
if (iinventory instanceof ITileInventory) {
|
||||||
switch (inventory.getSize()) {
|
getHandle().openContainer((ITileInventory) iinventory);
|
||||||
case 9:
|
} else {
|
||||||
customSize = Containers.GENERIC_9X1;
|
Containers customSize;
|
||||||
break;
|
switch (inventory.getSize()) {
|
||||||
case 18:
|
case 9:
|
||||||
customSize = Containers.GENERIC_9X2;
|
customSize = Containers.GENERIC_9X1;
|
||||||
break;
|
break;
|
||||||
case 27:
|
case 18:
|
||||||
customSize = Containers.GENERIC_9X3;
|
customSize = Containers.GENERIC_9X2;
|
||||||
break;
|
break;
|
||||||
case 36:
|
case 27:
|
||||||
case 41: // PLAYER
|
customSize = Containers.GENERIC_9X3;
|
||||||
customSize = Containers.GENERIC_9X4;
|
break;
|
||||||
break;
|
case 36:
|
||||||
case 45:
|
case 41: // PLAYER
|
||||||
customSize = Containers.GENERIC_9X5;
|
customSize = Containers.GENERIC_9X4;
|
||||||
break;
|
break;
|
||||||
case 54:
|
case 45:
|
||||||
customSize = Containers.GENERIC_9X6;
|
customSize = Containers.GENERIC_9X5;
|
||||||
break;
|
break;
|
||||||
default:
|
case 54:
|
||||||
throw new IllegalArgumentException("Unsupported custom inventory size " + inventory.getSize());
|
customSize = Containers.GENERIC_9X6;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new IllegalArgumentException("Unsupported custom inventory size " + inventory.getSize());
|
||||||
|
}
|
||||||
|
openCustomInventory(inventory, player, customSize);
|
||||||
}
|
}
|
||||||
openCustomInventory(inventory, player, customSize);
|
|
||||||
break;
|
break;
|
||||||
case DISPENSER:
|
case DISPENSER:
|
||||||
if (iinventory instanceof TileEntityDispenser) {
|
if (iinventory instanceof TileEntityDispenser) {
|
||||||
|
|
Loading…
Reference in a new issue