              tileentity.validate();
              chunkTileEntityMap.put(chunkposition, tileentity);
              return;
-@@ -777,8 +762,6 @@
+@@ -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++)
              {

                 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 @@
 
         }
 
+	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);
+	    }
         }
+	for(TileEntity te : invalidList)
+		te.invalidate();
 
         return k1;
     }
@@ -880,7 +866,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 +808,6 @@
         {
             for(int k3 = k; k3 < j1; k3++)
             {
