mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 14:35:12 +00:00
Add a Pre-Load Boolean to Scripts to they don't save Empty
This commit is contained in:
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
|
||||
|
||||
Reference in new issue
Block a user