Program: 109834
Project: 109834
Buggy source:
public void writeNBT(){
  HashMap<Block,Integer> mapBlockToInternalID=getBlockToInternalIDMap();
  try {
    if (levelData == null) {
      System.out.println("String_Node_Str");
      levelData=new NBTTagCompound();
    }
    int metadataInt[]=new int[map_sizeX * map_sizeY * map_sizeZ];
    int blockidsInt[]=new int[map_sizeX * map_sizeY * map_sizeZ];
    byte metadataByte[]=new byte[map_sizeX * map_sizeY * map_sizeZ];
    byte blockidsByte[]=new byte[map_sizeX * map_sizeY * map_sizeZ];
    NBTTagList var16=new NBTTagList();
    for (int xx=0; xx < map_sizeX; xx++) {
      for (int yy=0; yy < map_sizeY; yy++) {
        for (int zz=0; zz < map_sizeZ; zz++) {
          int index=yy * map_sizeX * map_sizeZ + zz * map_sizeX + xx;
          if (newFormat) {
            Integer tryID=mapBlockToInternalID.get(build_blockIDArr[xx][yy][zz]);
            if (tryID == null) {
              System.out.println("String_Node_Str" + build_blockIDArr[xx][yy][zz]);
            }
 else {
              int internalID=Integer.valueOf(tryID);
              blockidsInt[index]=internalID;
            }
            metadataInt[index]=build_blockMetaArr[xx][yy][zz];
          }
 else {
            System.out.println("String_Node_Str");
          }
          World worldRef=DimensionManager.getWorld(dim);
          TileEntity tEnt=worldRef.getTileEntity(map_coord_minX + xx,map_coord_minY + yy,map_coord_minZ + zz);
          if (tEnt != null) {
            NBTTagCompound var10=new NBTTagCompound();
            if (tEnt instanceof SchematicData) {
              ((SchematicData)tEnt).writeToNBT(var10,this);
            }
 else {
              tEnt.writeToNBT(var10);
            }
            var10.setBoolean("String_Node_Str",true);
            var10.setInteger("String_Node_Str",xx);
            var10.setInteger("String_Node_Str",yy);
            var10.setInteger("String_Node_Str",zz);
            var16.appendTag(var10);
          }
        }
      }
    }
    levelData.setTag("String_Node_Str",var16);
    if (newFormat) {
      levelData.setIntArray("String_Node_Str",blockidsInt);
      levelData.setIntArray("String_Node_Str",metadataInt);
    }
 else {
      levelData.setByteArray("String_Node_Str",blockidsByte);
      levelData.setByteArray("String_Node_Str",metadataByte);
    }
    levelData.setBoolean("String_Node_Str",newFormat);
    levelData.setString("String_Node_Str",getSaveVersion());
    levelData.setTag("String_Node_Str",genBlockIDToNameMap());
    levelData.setShort("String_Node_Str",(short)map_sizeX);
    levelData.setShort("String_Node_Str",(short)map_sizeY);
    levelData.setShort("String_Node_Str",(short)map_sizeZ);
    levelData.setShort("String_Node_Str",(short)map_surfaceOffset);
    saveLevelData(file);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
}

Fixed version (ground truth):
public void writeNBT(){
  HashMap<Block,Integer> mapBlockToInternalID=getBlockToInternalIDMap();
  try {
    if (levelData == null) {
      System.out.println("String_Node_Str");
      levelData=new NBTTagCompound();
    }
    int metadataInt[]=new int[map_sizeX * map_sizeY * map_sizeZ];
    int blockidsInt[]=new int[map_sizeX * map_sizeY * map_sizeZ];
    byte metadataByte[]=new byte[map_sizeX * map_sizeY * map_sizeZ];
    byte blockidsByte[]=new byte[map_sizeX * map_sizeY * map_sizeZ];
    NBTTagList var16=new NBTTagList();
    for (int xx=0; xx < map_sizeX; xx++) {
      for (int yy=0; yy < map_sizeY; yy++) {
        for (int zz=0; zz < map_sizeZ; zz++) {
          int index=yy * map_sizeX * map_sizeZ + zz * map_sizeX + xx;
          if (newFormat) {
            Integer tryID=mapBlockToInternalID.get(build_blockIDArr[xx][yy][zz]);
            if (tryID == null) {
              System.out.println("String_Node_Str" + build_blockIDArr[xx][yy][zz]);
            }
 else {
              int internalID=Integer.valueOf(tryID);
              blockidsInt[index]=internalID;
            }
            metadataInt[index]=build_blockMetaArr[xx][yy][zz];
          }
 else {
            System.out.println("String_Node_Str");
          }
          World worldRef=DimensionManager.getWorld(dim);
          TileEntity tEnt=worldRef.getTileEntity(new BlockPos(map_coord_minX + xx,map_coord_minY + yy,map_coord_minZ + zz));
          if (tEnt != null) {
            NBTTagCompound var10=new NBTTagCompound();
            if (tEnt instanceof SchematicData) {
              ((SchematicData)tEnt).writeToNBT(var10,this);
            }
 else {
              tEnt.writeToNBT(var10);
            }
            var10.setBoolean("String_Node_Str",true);
            var10.setInteger("String_Node_Str",xx);
            var10.setInteger("String_Node_Str",yy);
            var10.setInteger("String_Node_Str",zz);
            var16.appendTag(var10);
          }
        }
      }
    }
    levelData.setTag("String_Node_Str",var16);
    if (newFormat) {
      levelData.setIntArray("String_Node_Str",blockidsInt);
      levelData.setIntArray("String_Node_Str",metadataInt);
    }
 else {
      levelData.setByteArray("String_Node_Str",blockidsByte);
      levelData.setByteArray("String_Node_Str",metadataByte);
    }
    levelData.setBoolean("String_Node_Str",newFormat);
    levelData.setString("String_Node_Str",getSaveVersion());
    levelData.setTag("String_Node_Str",genBlockIDToNameMap());
    levelData.setShort("String_Node_Str",(short)map_sizeX);
    levelData.setShort("String_Node_Str",(short)map_sizeY);
    levelData.setShort("String_Node_Str",(short)map_sizeZ);
    levelData.setShort("String_Node_Str",(short)map_surfaceOffset);
    saveLevelData(file);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
}