mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 22:19:40 +00:00
1. JaninoHookResolver
2. Janino reflection based function calls like:
Color script = scriptHandler.callFunction("getColor", Color.class, ctx);
Compared to current:
Color script = scriptHandler.getScript().call(f -> f.getColor(ctx));
This commit is contained in:
1 parent
a032d24d65
commit
af62868387
5 files changed
+435
-109
No files matched your search
@@ -124,6 +124,13 @@ public class JaninoScriptHandler<S extends JaninoScript<?>> extends ScriptHandle
|
||||
deleteScript();
|
||||
}
|
||||
|
||||
public List<String> getHooks() {
|
||||
if (script != null)
|
||||
return script.getHookList();
|
||||
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IScriptUnit createJaninoScriptUnit() {
|
||||
return factory.get();
|
||||
|
||||
Reference in new issue
Block a user