kotlin
object FabricManagedEventsFabric implementation of [ManagedListenerProvider].
Fabric's event system ([Event]) does not support individual callback unregistration. To work around this, each managed listener wraps the user callback in a dynamic proxy with an active flag. On reload, all WORLD/SERVER_CACHE-scoped wrappers are deactivated.
Initialized once in [KattonFabric.onInitialize] via [initialize].
FabricManagedEvents.FabricListenerState
kotlin
class FabricListenerState(@Volatile var callback: Any?The Fabric event permanently owns the proxy, so the proxy may only retain this small host-loaded state object. Clearing [callback] releases the old script lambda and its classloader even though Fabric cannot remove the proxy itself.
