Fix Smeltery bottom-layers not really being part of the smeltery, therefore not causing updates to the smeltery.

This commit is contained in:
Bernhard Bonigl committed 2014-10-05 12:02:49 +02:00
1 parent 0e4691ecfe
commit d6cd145baa
2 files changed
+18 -3

No files matched your search

@@ -302,6 +302,8 @@ public class SmelteryBlock extends InventoryBlock
@Override
public void breakBlock (World world, int x, int y, int z, Block blockID, int meta)
{
// TE is not valid anymore at this point. :/
TileEntity logic = world.getTileEntity(x, y, z);
if (logic instanceof IServantLogic)
{
@@ -983,12 +983,24 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
{
for (int zPos = zMin; zPos <= zMax; zPos++)
{
if (validBlockID(worldObj.getBlock(xPos, y, zPos)) && (worldObj.getBlockMetadata(xPos, y, zPos) >= 2))
bottomBricks++;
if (validBlockID(worldObj.getBlock(xPos, y, zPos)) && (worldObj.getBlockMetadata(xPos, y, zPos) >= 2)) {
TileEntity te = worldObj.getTileEntity(xPos, y, zPos);
if (te instanceof MultiServantLogic) {
MultiServantLogic servant = (MultiServantLogic) te;
if (servant.hasValidMaster()) {
if (servant.verifyMaster(this, worldObj, this.xCoord, this.yCoord, this.zCoord))
bottomBricks++;
} else {
servant.overrideMaster(this.xCoord, this.yCoord, this.zCoord);
bottomBricks++;
}
}
}
}
}
int neededBricks = (xMax + 1 - xMin) * (zMax + 1 - zMin); // +1 because we want inclusive the upper border
int neededBricks = (xMax + 1 - xMin) * (zMax + 1 - zMin); // +1 because we want inclusive the upper bound
if (bottomBricks == neededBricks)
{
@@ -1017,6 +1029,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
else if (te instanceof MultiServantLogic)
{
MultiServantLogic servant = (MultiServantLogic) te;
if (servant.hasValidMaster())
{
if (servant.verifyMaster(this, worldObj, this.xCoord, this.yCoord, this.zCoord))