Fix Quest / Dialog Sync in Single player

This commit is contained in:
Kam committed 2024-03-08 02:50:51 -05:00
1 parent 23d2681753
commit fd1500b7ed
5 files changed
+8 -16

No files matched your search

@@ -221,12 +221,11 @@ public class QuestController implements IQuestHandler {
File file2 = new File(dir, quest.id + ".json");
try {
NBTTagCompound questCompound = quest.writeToNBTPartial(new NBTTagCompound());
NBTJsonUtil.SaveFile(file, questCompound);
NBTJsonUtil.SaveFile(file, quest.writeToNBTPartial(new NBTTagCompound()));
if(file2.exists())
file2.delete();
file.renameTo(file2);
Server.sendToAll(EnumPacketClient.SYNC_UPDATE, SyncType.QUEST, questCompound, category.id);
Server.sendToAll(EnumPacketClient.SYNC_UPDATE, SyncType.QUEST, quest.writeToNBT(new NBTTagCompound()), category.id);
} catch (Exception e) {
e.printStackTrace();
}