AutoRegistrar

Plug-and-play auto registration for commands and event listeners.

Design note

This lives in ktale-core because it is a convenience implementation, not a stable contract. It is safe to omit in other host runtimes.

Rules (conventions)

  • Commands:

  • classes that implement CommandDefinition

  • annotated with AutoCommand

  • public no-arg constructor

  • Event listeners:

  • any class with methods annotated SubscribeEvent

  • listener class must have a public no-arg constructor

Functions

Link copied to clipboard
fun registerAllFromClasses(classes: List<Class<*>>, context: PluginContext)
Link copied to clipboard
fun registerAllFromJar(pluginJar: Path, classLoader: ClassLoader, context: PluginContext)