mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-16 02:34:49 +00:00
ScriptWorld:
-Added functions from patch
This commit is contained in:
1 parent
f6b9f2c973
commit
dd7714350d
7 files changed
+12
-36
No files matched your search
@@ -150,8 +150,10 @@ public class ScriptContainer {
|
||||
if(errored || !hasCode() || unknownFunctions.contains(type) || !ConfigScript.ScriptingEnabled)
|
||||
return;
|
||||
|
||||
this.setEngine(handler.getLanguage());
|
||||
if(engine == null)
|
||||
return;
|
||||
|
||||
if(ScriptController.Instance.lastLoaded > this.lastCreated){
|
||||
this.lastCreated = ScriptController.Instance.lastLoaded;
|
||||
evaluated = false;
|
||||
@@ -232,14 +234,13 @@ public class ScriptContainer {
|
||||
}
|
||||
|
||||
public void setEngine(String scriptLanguage) {
|
||||
if(currentScriptLanguage != null && currentScriptLanguage.equals(scriptLanguage))
|
||||
return;
|
||||
if (ConfigScript.ScriptingECMA6 && scriptLanguage.equals("ECMAScript")) {
|
||||
System.setProperty("nashorn.args", "--language=es6");
|
||||
if (!Objects.equals(scriptLanguage, this.currentScriptLanguage)) {
|
||||
this.currentScriptLanguage = scriptLanguage;
|
||||
if (ConfigScript.ScriptingECMA6 && scriptLanguage.equals("ECMAScript")) {
|
||||
System.setProperty("nashorn.args", "--language=es6");
|
||||
}
|
||||
this.engine = ScriptController.Instance.getEngineByName(scriptLanguage.toLowerCase());
|
||||
this.evaluated = false;
|
||||
}
|
||||
this.engine = ScriptController.Instance.getEngineByName(scriptLanguage.toLowerCase());
|
||||
|
||||
currentScriptLanguage = scriptLanguage;
|
||||
evaluated = false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user