Interface IEventRegistry
public interface IEventRegistry
Holds all information pertaining to events and event buses.
An instance of this class can be obtained through
ICraftTweakerRegistry.
- Since:
- 11.0.0
-
Method Details
-
busOf
Obtains theIEventBusassociated to the given event type, represented as aTypeToken.Usage of this API is discouraged as the lookup is slower than accessing the bus for the event directly through Java code. This entry point is provided solely for automatic discovery for the ZenCode script interface.
- Type Parameters:
T- The type of the event.- Parameters:
eventType- The type of the event whose bus should be looked up.- Returns:
- The
IEventBusassociated to it. - Throws:
IllegalArgumentException- If the given event type does not exist.- Since:
- 11.0.0
-
busOf
Obtains theIEventBusassociated to the given event type, represented as aClass.Usage of this API is discouraged as the lookup is slower than accessing the bus for the event directly through Java code. This entry point is provided solely for automatic discovery for the ZenCode script interface.
- Type Parameters:
T- The type of the event.- Parameters:
clazz- The type of the event whose bus should be looked up.- Returns:
- The
IEventBusassociated to it. - Throws:
IllegalArgumentException- If the given event type does not exist.- Since:
- 11.0.0
-