                      }
  
                  }
-@@ -1847,7 +1855,25 @@
-                 tileentity.xCoord = i;
-                 tileentity.yCoord = j;
-                 tileentity.zCoord = k;
+@@ -1840,44 +1855,23 @@
+ 
+     public void setBlockTileEntity(int i, int j, int k, TileEntity tileentity)
+     {
+-        if(!tileentity.isInvalid())
+-        {
+-            if(scanningTileEntities)
+-            {
+-                tileentity.xCoord = i;
+-                tileentity.yCoord = j;
+-                tileentity.zCoord = k;
 -                addedTileEntityList.add(tileentity);
-+                
-+                // FORGE: This loop fixes a problem where, when scanning, the
-+                // same entity is added several times, making the client lag
-+                // crazyly when tile are requested during the scanning
-+                // process.
-+				boolean found = false;
-+
-+				for (Object o : addedTileEntityList) {
-+					TileEntity e = (TileEntity) o;
-+
-+					if (e.xCoord == i && e.yCoord == j && e.zCoord == k) {
-+						found = true;
-+						break;
-+					}
-+				}
-+
-+				if (!found) {
-+					addedTileEntityList.add(tileentity);
-+				}
-             } else
-             {
-                 loadedTileEntityList.add(tileentity);
-@@ -1895,13 +1921,18 @@
+-            } else
+-            {
+-                loadedTileEntityList.add(tileentity);
+-                Chunk chunk = getChunkFromChunkCoords(i >> 4, k >> 4);
+-                if(chunk != null)
+-                {
+-                    chunk.setChunkBlockTileEntity(i & 0xf, j, k & 0xf, tileentity);
+-                }
+-            }
+-        }
++	if(tileentity.isInvalid())
++		return;
++	List dest=scanningTileEntities ? addedTileEntityList :
++		loadedTileEntityList;
++	if(tileentity.canUpdate()) dest.add(tileentity);
++	Chunk chunk = getChunkFromChunkCoords(i >> 4, k >> 4);
++	if(chunk != null) {
++		chunk.setChunkBlockTileEntity(i & 0xf, j, k & 0xf, tileentity);
++	}
+     }
+ 
+     public void removeBlockTileEntity(int i, int j, int k)
+     {
+-        TileEntity tileentity = getBlockTileEntity(i, j, k);
+-        if(tileentity != null && scanningTileEntities)
+-        {
+-            tileentity.invalidate();
+-        } else
+-        {
+-            if(tileentity != null)
+-            {
+-                loadedTileEntityList.remove(tileentity);
+-            }
+-            Chunk chunk = getChunkFromChunkCoords(i >> 4, k >> 4);
+-            if(chunk != null)
+-            {
+-                chunk.removeChunkBlockTileEntity(i & 0xf, j, k & 0xf);
+-            }
+-        }
++	Chunk chunk = getChunkFromChunkCoords(i >> 4, k >> 4);
++	if(chunk != null) {
++		chunk.removeChunkBlockTileEntity(i & 0xf, j, k & 0xf);
++	}
+     }
+ 
+     public boolean isBlockOpaqueCube(int i, int j, int k)
+@@ -1895,13 +1889,18 @@
      public boolean isBlockNormalCube(int i, int j, int k)
      {
          Block block = Block.blocksList[getBlockId(i, j, k)];

                 flag = true;
             }
diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/BlockPressurePlate.java ../src_work/minecraft/net/minecraft/src/BlockPressurePlate.java
--- ../src_base/minecraft/net/minecraft/src/BlockPressurePlate.java	2011-09-07 21:52:10.485802000 +0200
+++ ../src_work/minecraft/net/minecraft/src/BlockPressurePlate.java	2011-09-07 21:53:05.666958300 +0200
@@ -46,7 +46,7 @@
 
     public boolean canPlaceBlockAt(World world, int i, int j, int k)

+    public int subHit=-1;
 }
diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/src/PlayerInstance.java ../src_work/minecraft_server/net/minecraft/src/PlayerInstance.java
--- ../src_base/minecraft_server/net/minecraft/src/PlayerInstance.java	2011-09-08 13:52:47.000000000 -0400
+++ ../src_work/minecraft_server/net/minecraft/src/PlayerInstance.java	2011-09-08 13:52:48.000000000 -0400
@@ -169,12 +169,11 @@
             sendPacketToPlayersInInstance(new Packet52MultiBlockChange(chunkX, chunkZ, blocksToUpdate, numBlocksToUpdate, worldserver));
             for(int k = 0; k < numBlocksToUpdate; k++)
