Skip to content

Commit

Permalink
Fix smeltery updates if height doesn't change and some more smeltery …
Browse files Browse the repository at this point in the history
…updating derps.
  • Loading branch information
bonii-xx committed Sep 18, 2014
1 parent 00e3877 commit d5f0a51
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/main/java/tconstruct/smeltery/logic/SmelteryLogic.java
Expand Up @@ -248,7 +248,6 @@ public boolean getActive ()
@Override
public void setActive (boolean flag)
{
needsUpdate = true;
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}

Expand Down Expand Up @@ -721,8 +720,8 @@ public int getInventoryStackLimit ()
@Override
public void markDirty ()
{
updateTemperatures();
updateEntity();
updateTemperatures();

super.markDirty();
needsUpdate = true;
Expand Down Expand Up @@ -877,13 +876,15 @@ public void checkValidStructure (int x, int y, int z, int[] sides)
activeLavaTank = lavaTanks.get(0);

// update other stuff
adjustLayers(checkLayers, false);
adjustLayers(checkLayers, true);
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
validStructure = true;
}
else
{
internalTemp = 20;
if(validStructure)
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
validStructure = false;
}
}
Expand Down Expand Up @@ -1190,8 +1191,6 @@ public void readFromNBT (NBTTagCompound tags)
inventory = new ItemStack[maxBlockCapacity];
super.readFromNBT(tags);

if(!tags.getBoolean("ValidStructure"))
validStructure = false; // only negative update because we want to do a clientside structure check too
internalTemp = tags.getInteger("InternalTemp");
inUse = tags.getBoolean("InUse");

Expand All @@ -1212,6 +1211,15 @@ public void readFromNBT (NBTTagCompound tags)
if (fluid != null)
moltenMetal.add(fluid);
}

if(maxBlockCapacity != meltingTemps.length)
adjustLayers(layers, true);

if(!tags.getBoolean("ValidStructure"))
validStructure = false; // only negative update because we want to do a clientside structure check too
else if(!validStructure)
checkValidPlacement();

// adjustLayers(layers, true);
// checkValidPlacement();
}
Expand Down

0 comments on commit d5f0a51

Please sign in to comment.