mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-22 02:42:18 +00:00
Test Janino
This commit is contained in:
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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user