kotlin
object FabricManagedEvents[ManagedListenerProvider] 的 Fabric 实现。
Fabric 的事件系统 ([Event]) 不支持单个回调的注销。 为了绕开这一点,每个 managed listener 都会用带有 active 标记的动态代理包装用户回调。 在重载时,所有 WORLD/SERVER_CACHE 作用域的包装器都会被停用。
该对象通过 [initialize] 在 [KattonFabric.onInitialize] 中完成一次初始化。
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.
