Fixed script console not appearing with the new global script tab saving method.

This commit is contained in:
Luis C.M committed 2023-02-19 15:20:51 -06:00
1 parent 79e13dfade
commit de6375c4cb
10 files changed
+58 -47

No files matched your search

@@ -7,6 +7,7 @@ package noppes.npcs.client.gui.script;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import noppes.npcs.NBTTags;
import noppes.npcs.client.Client;
import noppes.npcs.constants.EnumPacketServer;
import noppes.npcs.controllers.ScriptContainer;
@@ -27,6 +28,7 @@ public class GuiScriptPlayers extends GuiScriptInterface {
if (!compound.hasKey("Tab")) {
script.setLanguage(compound.getString("ScriptLanguage"));
script.setEnabled(compound.getBoolean("ScriptEnabled"));
script.setConsoleText(NBTTags.GetLongStringMap(compound.getTagList("ScriptConsole", 10)));
super.setGuiData(compound);
} else {
int tab = compound.getInteger("Tab");
@@ -52,6 +54,7 @@ public class GuiScriptPlayers extends GuiScriptInterface {
NBTTagCompound scriptData = new NBTTagCompound();
scriptData.setString("ScriptLanguage", this.script.getLanguage());
scriptData.setBoolean("ScriptEnabled", this.script.getEnabled());
scriptData.setTag("ScriptConsole", NBTTags.NBTLongStringMap(this.script.getConsoleText()));
Client.sendData(EnumPacketServer.ScriptPlayerSave, -1, scriptData);
}
}