Fixed comparator support for chests

This commit is contained in:
FireBall1725 2014-07-31 19:42:02 -04:00
parent f677d09103
commit 000ef0bc51
1 changed files with 11 additions and 1 deletions

View File

@ -256,11 +256,20 @@ public class BlockIronChest extends BlockContainer {
return super.getExplosionResistance(par1Entity, world, x, y, z, explosionX, explosionY, explosionZ); return super.getExplosionResistance(par1Entity, world, x, y, z, explosionX, explosionY, explosionZ);
} }
@Override
public boolean hasComparatorInputOverride() {
return true;
}
@Override @Override
public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5)
{ {
return Container.calcRedstoneFromInventory((TileEntityIronChest) par1World.getTileEntity(par2, par3, par4)); TileEntity te = par1World.getTileEntity(par2, par3, par4);
if (te instanceof IInventory)
{
return Container.calcRedstoneFromInventory((IInventory)te);
}
return 0;
} }
@ -299,4 +308,5 @@ public class BlockIronChest extends BlockContainer {
} }
return false; return false;
} }
} }