Class NilModBase

java.lang.Object
me.tamkungz.nilkit.NilModBase
All Implemented Interfaces:
Runnable

public abstract class NilModBase extends Object implements Runnable
Base class for NilLoader mods. Provides remap, logger, and buildInfo ready to use. Override onLoad() instead of run() for mod initialization logic.
  • Field Details

    • log

      protected final nilloader.api.NilLogger log
    • remap

      protected final SimpleRemap remap
    • buildInfo

      protected final ModBuildInfo buildInfo
  • Constructor Details

  • Method Details

    • run

      public final void run()
      Specified by:
      run in interface Runnable
    • onLoad

      protected abstract void onLoad() throws Throwable
      Called automatically from run(). Override this to implement mod initialization logic.
      Throws:
      Throwable
    • registerEvents

      protected final void registerEvents()
      Registers annotated listener methods in this mod instance to the global SDK EventBus.
    • registerEvents

      protected final void registerEvents(Object listener)
      Registers annotated listener methods from the provided instance to the global SDK EventBus.
    • listen

      protected final <T extends Event> void listen(Class<T> eventType, EventBus.EventListener<T> listener)
      Registers a typed listener callback using NORMAL priority.
    • listen

      protected final <T extends Event> void listen(Class<T> eventType, EventBus.EventListener<T> listener, EventPriority priority, boolean receiveCancelled)
      Registers a typed listener callback with explicit delivery options.
    • unlisten

      protected final <T extends Event> void unlisten(Class<T> eventType, EventBus.EventListener<T> listener)
      Removes a typed listener callback previously registered with listen().
    • post

      protected final boolean post(Event event)
      Posts an event to the global SDK EventBus.