Test Janino

This commit is contained in:
Kam committed 2026-01-22 16:24:48 -05:00
1 parent 73f0d4e441
commit e6221c0940
3 files changed
+184 -192

No files matched your search

@@ -202,15 +202,18 @@ public abstract class JaninoScript<T> implements IScriptUnit {
if (hookName == null || hookName.isEmpty())
return null;
Method method = hookResolver.resolveHookMethod(hookName, args);
if (method == null)
return null;
// Ensure compiled first so we can search the compiled class
ensureCompiled();
T t = getUnsafe();
if (t == null)
return null;
// Pass compiled instance to enable dynamic hook resolution
// This allows users to define methods for ANY hook (Forge events, addon hooks, etc.)
Method method = hookResolver.resolveHookMethod(hookName, args, t);
if (method == null)
return null;
Method invokeMethod = method;
Object[] invokeArgs = args == null ? new Object[0] : args;