Add a Pre-Load Boolean to Scripts to they don't save Empty

This commit is contained in:
Kam committed 2025-05-29 21:09:58 -04:00
1 parent d119a7524e
commit 236b901e61
11 files changed
+129 -71

No files matched your search

@@ -27,6 +27,7 @@ public class GuiScript extends GuiNPCInterface implements IGuiData, GuiYesNoCall
public Map<String, List<String>> languages = new HashMap<String, List<String>>();
private static int activeConsole = 0;
boolean loaded = false;
public GuiScript(EntityNPCInterface npc) {
super(npc);
@@ -258,12 +259,15 @@ public class GuiScript extends GuiNPCInterface implements IGuiData, GuiYesNoCall
}
this.languages = languages;
initGui();
loaded = true;
}
@Override
public void save() {
setScript();
NPCScriptPacket.Save(script.writeToNBT(new NBTTagCompound()));
if(loaded){
setScript();
NPCScriptPacket.Save(script.writeToNBT(new NBTTagCompound()));
}
}
@Override