mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 06:07:27 +00:00
Fixed nashorn factory not being found in a dev environment
This commit is contained in:
1 parent
326447bf7a
commit
d433eccef1
1 file changed
+6
-4
@@ -56,14 +56,16 @@ public class ScriptController {
|
||||
Instance = this;
|
||||
manager = new ScriptEngineManager();
|
||||
LogWriter.info("Script Engines Available:");
|
||||
|
||||
ScriptEngine engine = manager.getEngineByName("nashorn");
|
||||
if (engine != null) {
|
||||
this.nashornFactory = engine.getFactory();
|
||||
}
|
||||
|
||||
for(ScriptEngineFactory fac : manager.getEngineFactories()){
|
||||
if(fac.getExtensions().isEmpty())
|
||||
continue;
|
||||
|
||||
if (fac.getEngineName().equals("Oracle Nashorn")) {
|
||||
this.nashornFactory = fac;
|
||||
}
|
||||
|
||||
ScriptEngine scriptEngine = fac.getScriptEngine();
|
||||
try {
|
||||
scriptEngine.put("$RunTest",null);
|
||||
|
||||
Reference in new issue
Block a user