package noppes.npcs.api.handler; import java.util.List; /** * Handler for registering and retrieving script hooks. * Addon mods can register custom hooks that will appear in the script editor GUIs. * *
{@code
* hooks.registerHookDefinition("player",
* HookDefinition.of("onDBCTransform", IDBCEvent.TransformEvent.class));
* }
*/
public interface IScriptHookHandler {
/**
* Register a hook with full metadata including event type and imports.
*
* @param context The context identifier (e.g., "npc", "player", "block")
* @param definition The hook definition containing all metadata
*/
void registerHookDefinition(String context, IHookDefinition definition);
/**
* Get the hook definition for a specific hook.
*
* @param context The context identifier
* @param hookName The hook function name
* @return The hook definition, or null if not found
*/
IHookDefinition getHookDefinition(String context, String hookName);
/**
* Get all hook definitions for a context.
*
* @param context The context identifier
* @return List of all hook definitions (may be empty, never null)
*/
List