                  int k4 = (k2 << 11 | k3 << 7 | j) >> 1;
                  int k5 = (i1 - j) / 2;
                  System.arraycopy(abyte0, k1, skylightMap.data, k4, k5);
-@@ -830,11 +807,20 @@
- 
-         }
- 
+@@ -830,12 +816,24 @@
+ 
+         }
+ 
+-        TileEntity tileentity;
+-        for(Iterator iterator = chunkTileEntityMap.values().iterator(); iterator.hasNext(); tileentity.func_35144_b())
+-        {
+-            tileentity = (TileEntity)iterator.next();
 +	List<TileEntity> invalidList=new ArrayList();
-         TileEntity tileentity;
-         for(Iterator iterator = chunkTileEntityMap.values().iterator(); iterator.hasNext(); tileentity.func_35144_b())
-         {
-             tileentity = (TileEntity)iterator.next();
-+	    if( (tileentity.xCoord&15)>=i && (tileentity.xCoord&15)<=l &&
-+		    tileentity.yCoord>=j && tileentity.yCoord<=i1 &&
-+		    (tileentity.zCoord&15)>=k && (tileentity.zCoord&15)<=j1) {
-+
-+		    invalidList.add(tileentity);
++	iterator = chunkTileEntityMap.values().iterator(); 
++        while(iterator.hasNext()) {
++            te = (TileEntity)iterator.next();
++	    if( (te.xCoord&15)>=i && (te.xCoord&15)<=l &&
++		    te.yCoord>=j && te.yCoord<=i1 &&
++		    (te.zCoord&15)>=k && (te.zCoord&15)<=j1) {
++
++		    if(te.getBlockType().blockID==
++			worldObj.getBlockId(te.xCoord,te.yCoord,te.zCoord) &&
++			te.getBlockMetadata()==worldObj.getBlockMetadata(
++				te.xCoord,te.yCoord,te.zCoord))
++			    continue;
++		    invalidList.add(te);
 +	    }
          }
-+	for(TileEntity te : invalidList)
-+		te.invalidate();
- 
+-
++	for(TileEntity te2 : invalidList)
++		te2.invalidate();
          return k1;
      }
-@@ -880,7 +866,6 @@
+ 
+@@ -880,7 +878,6 @@
          int l = precipitationHeightMap[k];
          if(l == -999)
          {

                 int j4 = (j2 << 11 | j3 << 7 | j) >> 1;
                 int j5 = (i1 - j) / 2;
                 System.arraycopy(abyte0, k1, blocklightMap.data, j4, j5);
@@ -820,8 +799,6 @@
         {
             for(int k3 = k; k3 < j1; k3++)
             {

             tileentity.validate();
             chunkTileEntityMap.put(chunkposition, tileentity);
             return;
@@ -773,12 +758,19 @@
     public int setChunkData(byte abyte0[], int i, int j, int k, int l, int i1, int j1, 
             int k1)
     {
+        TileEntity te;
+	Iterator iterator = chunkTileEntityMap.values().iterator(); 
+        while(iterator.hasNext()) {
+		te = (TileEntity)iterator.next();
+		te.func_35144_b();
+		te.getBlockMetadata();
+		te.getBlockType();
+	}
+
         for(int l1 = i; l1 < l; l1++)
         {
             for(int l2 = k; l2 < j1; l2++)
             {
