Package me.tamkungz.nilkit
Class NilModBase
java.lang.Object
me.tamkungz.nilkit.NilModBase
- All Implemented Interfaces:
Runnable
Base class for NilLoader mods.
Provides remap, logger, and buildInfo ready to use.
Override onLoad() instead of run() for mod initialization logic.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ModBuildInfoprotected final nilloader.api.NilLoggerprotected final SimpleRemap -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final <T extends Event>
voidlisten(Class<T> eventType, EventBus.EventListener<T> listener) Registers a typed listener callback using NORMAL priority.protected final <T extends Event>
voidlisten(Class<T> eventType, EventBus.EventListener<T> listener, EventPriority priority, boolean receiveCancelled) Registers a typed listener callback with explicit delivery options.protected abstract voidonLoad()Called automatically from run().protected final booleanPosts an event to the global SDK EventBus.protected final voidRegisters annotated listener methods in this mod instance to the global SDK EventBus.protected final voidregisterEvents(Object listener) Registers annotated listener methods from the provided instance to the global SDK EventBus.final voidrun()protected final <T extends Event>
voidunlisten(Class<T> eventType, EventBus.EventListener<T> listener) Removes a typed listener callback previously registered with listen().
-
Field Details
-
log
protected final nilloader.api.NilLogger log -
remap
-
buildInfo
-
-
Constructor Details
-
NilModBase
-
-
Method Details
-
run
public final void run() -
onLoad
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
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
Posts an event to the global SDK EventBus.
-