AEventObject¶
abstract class AEventObject<T, H : Handler<T>, C : HandlerConstructor<T, H>>(val mod: Mod)
Base class for a mod-scoped Architectury event wrapper (e.g. archie-datagen's GatherDataHandler, archie-gametest's RegisterGameTestHandler).
Subclasses wire together an Architectury event, the handlerConstructor that builds a mod-scoped H from a T callback, and the handler logic itself, then call init once (idempotently, thread-safely) to register with the underlying event.
Parameters¶
-
T: The event payload/receiver type passed to
handler. -
C: The
HandlerConstructorthat builds anH. -
mod: The Mod this event object is scoped to.
Constructors¶
AEventObject¶
constructor(mod: Mod)
Parameters
-
T: The event payload/receiver type passed to
handler. -
C: The
HandlerConstructorthat builds anH. -
mod: The Mod this event object is scoped to.
Properties¶
event¶
The underlying Architectury event this wrapper registers a handler with.
handlerConstructor¶
abstract val handlerConstructor: C
mod¶
val mod: Mod
Parameters
- mod: The Mod this event object is scoped to.
Functions¶
handler¶
init¶
fun init()
Registers handler with event via handlerConstructor. Safe to call multiple times; only the first call has any effect.