mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 07:35:11 +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
@@ -67,7 +67,13 @@ public class ScriptController {
|
||||
for(ScriptEngineFactory fac : manager.getEngineFactories()){
|
||||
if(fac.getExtensions().isEmpty())
|
||||
continue;
|
||||
fac.getScriptEngine();
|
||||
ScriptEngine scriptEngine = fac.getScriptEngine();
|
||||
try {
|
||||
scriptEngine.put("$RunTest",null);
|
||||
} catch (Exception e) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String ext = "." + fac.getExtensions().get(0).toLowerCase();
|
||||
LogWriter.info(fac.getLanguageName() + ": " + ext);
|
||||
languages.put(fac.getLanguageName(), ext);
|
||||
|
||||
Reference in new issue
Block a user