Merge pull request #14 from FireBall1725/master

Fixed comparator support for chests
This commit is contained in:
Zach 2014-07-31 19:51:55 -04:00
commit 2628cbd41e
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;
} }
} }