mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-15 19:34:49 +00:00
The script controller now checks whether a language can have objects loaded into it on startup, catching an exception and skipping that language as available if so.
This commit is contained in:
1 parent
e4eb0e9cd8
commit
c0406958a3
7 files changed
+40
-12
No files matched your search
@@ -38,6 +38,13 @@ public class ForgeDataScript implements IScriptHandler {
|
||||
public void readFromNBT(NBTTagCompound compound) {
|
||||
this.scripts = NBTTags.GetScript(compound.getTagList("Scripts", 10), this);
|
||||
this.scriptLanguage = compound.getString("ScriptLanguage");
|
||||
if (!ScriptController.Instance.languages.containsKey(scriptLanguage)) {
|
||||
if (!ScriptController.Instance.languages.isEmpty()) {
|
||||
this.scriptLanguage = (String) ScriptController.Instance.languages.keySet().toArray()[0];
|
||||
} else {
|
||||
this.scriptLanguage = "ECMAScript";
|
||||
}
|
||||
}
|
||||
this.enabled = compound.getBoolean("ScriptEnabled");
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user