getHookTypes is now cached imports based

This commit is contained in:
bigguy345 committed 2026-01-23 20:12:18 +02:00
1 parent d3f06f8866
commit 6d62a44be5
1 file changed
+1 -10
@@ -418,16 +418,7 @@ public abstract class JaninoScript<T> implements IScriptUnit {
*/
public Set<String> getHookTypes() {
Set<String> types = new HashSet<>();
for (Method method : type.getDeclaredMethods()) {
// Add parameter types
for (Class<?> paramType : method.getParameterTypes())
addTypeAndEnclosingTypes(types, paramType);
// Add return types (in case any hook has a non-void return)
Class<?> returnType = method.getReturnType();
if (returnType != void.class)
addTypeAndEnclosingTypes(types, returnType);
}
Collections.addAll(types, getCachedImports());
return types;
}