SPIGOT-3981: Make custom inventories return specialised types where practical.

By: Senmori <thesenmori@gmail.com>
This commit is contained in:
CraftBukkit/Spigot
2018-07-25 18:03:26 +10:00
parent 8ee6f8cd25
commit 64f2fdae29
5 changed files with 202 additions and 5 deletions

View File

@@ -189,6 +189,15 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
IInventory iinventory = (inventory instanceof CraftInventory) ? ((CraftInventory) inventory).getInventory() : new org.bukkit.craftbukkit.inventory.InventoryWrapper(inventory);
if (iinventory instanceof ITileInventory) {
if (iinventory instanceof TileEntity) {
TileEntity te = (TileEntity) iinventory;
if (!te.u()) { // PAIL rename hasWorld
te.setWorld(getHandle().world);
}
}
}
switch (type) {
case PLAYER:
case CHEST: