void SaveHandler::saveWorldInfoAndPlayer(WorldInfo worldinfo, List list) { NBTTagCompound nbttagcompound = worldinfo.getNBTTagCompoundWithPlayer(list); NBTTagCompound nbttagcompound1 = new NBTTagCompound(); nbttagcompound1.setTag("Data", nbttagcompound); try { File file = new File(saveDirectory, "level.dat_new"); File file1 = new File(saveDirectory, "level.dat_old"); File file2 = new File(saveDirectory, "level.dat"); CompressedStreamTools.writeGzippedCompoundToOutputStream(nbttagcompound1, new FileOutputStream(file)); if(file1.exists()) { file1.delete(); } file2.renameTo(file1); if(file2.exists()) { file2.delete(); }