LLibrary

LLibrary

67M Downloads

WorldDataHandler Saving Behavior

Elenterius opened this issue ยท 1 comments

commented

if (!dataFile.exists()) {
try {
dataFile.createNewFile();
} catch (IOException e) {
LLibrary.LOGGER.error(CrashReport.makeCrashReport(e, "Failed to create file " + dataFile.getName()).getCompleteReport());
continue;
}
NBTTagCompound compound = new NBTTagCompound();
dataAdapter.saveNBTData(compound, world);
try {
FileOutputStream outputStream = new FileOutputStream(dataFile);
CompressedStreamTools.writeCompressed(compound, outputStream);
outputStream.close();
} catch (IOException e) {
LLibrary.LOGGER.error(CrashReport.makeCrashReport(e, "Failed to write file " + dataFile.getName()).getCompleteReport());
}
}

Just wondering if this is the intended behavior:
The data is only saved once when the save file doesn't exist yet.
This means existing files aren't updated, so you have to change the DataAdapter Id to save changed data.

commented

Yep, that looks very wrong. :P Thanks for the report.