SPIGOT-3981: Make custom inventories return specialised types where practical.
By: Senmori <thesenmori@gmail.com>
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user