public static void storeChunkInCompound(Chunk var0, World var1, NBTTagCompound var2) {
      var1.checkSessionLock();
      var2.setInteger("xPos", var0.xPosition);
      var2.setInteger("zPos", var0.zPosition);
      var2.setLong("LastUpdate", var1.getWorldTime());
      var2.setByteArray("Blocks", var0.blocks);
      var2.setByteArray("Data", var0.data.data);
      var2.setByteArray("SkyLight", var0.skylightMap.data);
      var2.setByteArray("BlockLight", var0.blocklightMap.data);
      var2.setByteArray("HeightMap", var0.heightMap);
      var2.setBoolean("TerrainPopulated", var0.isTerrainPopulated);
      var0.hasEntities = false;
      NBTTagList var3 = new NBTTagList();

      Iterator var5;
      NBTTagCompound var7;
      for(int var4 = 0; var4 < var0.entities.length; ++var4) {
         var5 = var0.entities[var4].iterator();

         while(var5.hasNext()) {
            Entity var6 = (Entity)var5.next();
            var0.hasEntities = true;
            var7 = new NBTTagCompound();
            if(var6.addEntityID(var7)) {
               var3.setTag(var7);
            }
         }
      }

      var2.setTag("Entities", var3);
      NBTTagList var8 = new NBTTagList();
      var5 = var0.chunkTileEntityMap.values().iterator();

      while(var5.hasNext()) {
         TileEntity var9 = (TileEntity)var5.next();
         var7 = new NBTTagCompound();
         var9.writeToNBT(var7);
         var8.setTag(var7);
      }

      var2.setTag("TileEntities", var8);
   }