fix some tiles dropping stuff that can't be dropped

This commit is contained in:
Raoul Van den Berge
2015-12-22 13:07:57 +01:00
parent 3b143310e3
commit 2c65adaaee
5 changed files with 24 additions and 1 deletions

View File

@@ -83,7 +83,7 @@ public abstract class BlockBase extends Block
{
TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof IInventory)
if (tile instanceof IInventory && tile instanceof TileBase && ((TileBase) tile).canDropInventory())
{
InventoryUtils.dropInventory(world, (IInventory) tile, x, y, z);
}

View File

@@ -77,4 +77,9 @@ public abstract class TileBase extends TileEntity
{
direction = ForgeDirection.getOrientation(packet.func_148857_g().getInteger("Direction"));
}
public boolean canDropInventory()
{
return true;
}
}

View File

@@ -290,4 +290,10 @@ public class TileDetector extends TileMachine implements IInventory, ISidedInven
buf.writeInt(amount);
buf.writeBoolean(providesPower);
}
@Override
public boolean canDropInventory()
{
return false;
}
}

View File

@@ -232,4 +232,10 @@ public class TileExporter extends TileMachine implements IInventory, ISidedInven
buf.writeInt(compare);
}
@Override
public boolean canDropInventory()
{
return false;
}
}

View File

@@ -280,4 +280,10 @@ public class TileImporter extends TileMachine implements IInventory, ISidedInven
buf.writeInt(compare);
buf.writeInt(mode);
}
@Override
public boolean canDropInventory()
{
return false;
}
}