Package com.hypixel.hytale.event
Class EventBus
java.lang.Object
com.hypixel.hytale.event.EventBus
- All Implemented Interfaces:
IEventBus,IEventRegistry
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final com.hypixel.hytale.logger.HytaleLoggerprivate final Map<Class<? extends IBaseEvent<?>>, com.hypixel.hytale.event.EventBusRegistry<?, ?, ?>> private final boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<KeyType,EventType extends IEvent<KeyType>>
IEventDispatcher<EventType, EventType> dispatchFor(Class<? super EventType> eventClass, KeyType key) <KeyType,EventType extends IAsyncEvent<KeyType>>
IEventDispatcher<EventType, CompletableFuture<EventType>> dispatchForAsync(Class<? super EventType> eventClass, KeyType key) private <KeyType,EventType extends IAsyncEvent<KeyType>>
com.hypixel.hytale.event.AsyncEventBusRegistry<KeyType, EventType> getAsyncRegistry(Class<? super EventType> eventClass) Set<Class<? extends IBaseEvent<?>>> <KeyType,EventType extends IBaseEvent<KeyType>>
com.hypixel.hytale.event.EventBusRegistry<KeyType, EventType, ?> getRegistry(Class<? super EventType> eventClass) com.hypixel.hytale.event.EventBusRegistry<?, ?, ?> getRegistry(String eventName) <KeyType,EventType extends IEvent<KeyType>>
com.hypixel.hytale.event.EventBusRegistry<KeyType, EventType, ?> getSyncRegistry(Class<? super EventType> eventClass) <EventType extends IBaseEvent<Void>>
EventRegistration<Void, EventType> <KeyType,EventType extends IBaseEvent<KeyType>>
EventRegistration<KeyType, EventType> register(short priority, Class<? super EventType> eventClass, KeyType key, Consumer<EventType> consumer) <EventType extends IBaseEvent<Void>>
EventRegistration<Void, EventType> register(EventPriority priority, Class<? super EventType> eventClass, Consumer<EventType> consumer) <KeyType,EventType extends IBaseEvent<KeyType>>
EventRegistration<KeyType, EventType> register(EventPriority priority, Class<? super EventType> eventClass, KeyType key, Consumer<EventType> consumer) <EventType extends IBaseEvent<Void>>
EventRegistration<Void, EventType> <KeyType,EventType extends IBaseEvent<KeyType>>
EventRegistration<KeyType, EventType> <EventType extends IAsyncEvent<Void>>
EventRegistration<Void, EventType> registerAsync(short priority, Class<? super EventType> eventClass, Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) <KeyType,EventType extends IAsyncEvent<KeyType>>
EventRegistration<KeyType, EventType> registerAsync(short priority, Class<? super EventType> eventClass, KeyType key, Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) <EventType extends IAsyncEvent<Void>>
EventRegistration<Void, EventType> registerAsync(EventPriority priority, Class<? super EventType> eventClass, Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) <KeyType,EventType extends IAsyncEvent<KeyType>>
EventRegistration<KeyType, EventType> registerAsync(EventPriority priority, Class<? super EventType> eventClass, KeyType key, Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) <EventType extends IAsyncEvent<Void>>
EventRegistration<Void, EventType> registerAsync(Class<? super EventType> eventClass, Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) <KeyType,EventType extends IAsyncEvent<KeyType>>
EventRegistration<KeyType, EventType> registerAsync(Class<? super EventType> eventClass, KeyType key, Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) <KeyType,EventType extends IAsyncEvent<KeyType>>
EventRegistration<KeyType, EventType> registerAsyncGlobal(short priority, Class<? super EventType> eventClass, Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) <KeyType,EventType extends IAsyncEvent<KeyType>>
EventRegistration<KeyType, EventType> registerAsyncGlobal(EventPriority priority, Class<? super EventType> eventClass, Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) <KeyType,EventType extends IAsyncEvent<KeyType>>
EventRegistration<KeyType, EventType> registerAsyncGlobal(Class<? super EventType> eventClass, Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) <KeyType,EventType extends IAsyncEvent<KeyType>>
EventRegistration<KeyType, EventType> registerAsyncUnhandled(short priority, Class<? super EventType> eventClass, Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) <KeyType,EventType extends IAsyncEvent<KeyType>>
EventRegistration<KeyType, EventType> registerAsyncUnhandled(EventPriority priority, Class<? super EventType> eventClass, Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) <KeyType,EventType extends IAsyncEvent<KeyType>>
EventRegistration<KeyType, EventType> registerAsyncUnhandled(Class<? super EventType> eventClass, Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) <KeyType,EventType extends IBaseEvent<KeyType>>
EventRegistration<KeyType, EventType> registerGlobal(short priority, Class<? super EventType> eventClass, Consumer<EventType> consumer) <KeyType,EventType extends IBaseEvent<KeyType>>
EventRegistration<KeyType, EventType> registerGlobal(EventPriority priority, Class<? super EventType> eventClass, Consumer<EventType> consumer) <KeyType,EventType extends IBaseEvent<KeyType>>
EventRegistration<KeyType, EventType> registerGlobal(Class<? super EventType> eventClass, Consumer<EventType> consumer) <KeyType,EventType extends IBaseEvent<KeyType>>
EventRegistration<KeyType, EventType> registerUnhandled(short priority, Class<? super EventType> eventClass, Consumer<EventType> consumer) <KeyType,EventType extends IBaseEvent<KeyType>>
EventRegistration<KeyType, EventType> registerUnhandled(EventPriority priority, Class<? super EventType> eventClass, Consumer<EventType> consumer) <KeyType,EventType extends IBaseEvent<KeyType>>
EventRegistration<KeyType, EventType> registerUnhandled(Class<? super EventType> eventClass, Consumer<EventType> consumer) voidshutdown()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.hypixel.hytale.event.IEventBus
dispatch, dispatchAsync, dispatchFor, dispatchForAsync
-
Field Details
-
LOGGER
@Nonnull private static final com.hypixel.hytale.logger.HytaleLogger LOGGER -
registryMap
@Nonnull private final Map<Class<? extends IBaseEvent<?>>,com.hypixel.hytale.event.EventBusRegistry<?, registryMap?, ?>> -
timeEvents
private final boolean timeEvents
-
-
Constructor Details
-
EventBus
public EventBus(boolean timeEvents)
-
-
Method Details
-
shutdown
public void shutdown() -
getRegisteredEventClasses
-
getRegisteredEventClassNames
-
getRegistry
@Nullable public com.hypixel.hytale.event.EventBusRegistry<?,?, getRegistry?> (@Nonnull String eventName) -
getRegistry
@Nonnull public <KeyType,EventType extends IBaseEvent<KeyType>> com.hypixel.hytale.event.EventBusRegistry<KeyType,EventType, getRegistry?> (@Nonnull Class<? super EventType> eventClass) -
getSyncRegistry
-
getAsyncRegistry
@Nonnull private <KeyType,EventType extends IAsyncEvent<KeyType>> com.hypixel.hytale.event.AsyncEventBusRegistry<KeyType,EventType> getAsyncRegistry(@Nonnull Class<? super EventType> eventClass) -
register
public <EventType extends IBaseEvent<Void>> EventRegistration<Void,EventType> register(@Nonnull Class<? super EventType> eventClass, @Nonnull Consumer<EventType> consumer) - Specified by:
registerin interfaceIEventRegistry
-
register
public <EventType extends IBaseEvent<Void>> EventRegistration<Void,EventType> register(@Nonnull EventPriority priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Consumer<EventType> consumer) - Specified by:
registerin interfaceIEventRegistry
-
register
public <EventType extends IBaseEvent<Void>> EventRegistration<Void,EventType> register(short priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Consumer<EventType> consumer) - Specified by:
registerin interfaceIEventRegistry
-
register
public <KeyType,EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType,EventType> register(@Nonnull Class<? super EventType> eventClass, @Nonnull KeyType key, @Nonnull Consumer<EventType> consumer) - Specified by:
registerin interfaceIEventRegistry
-
register
public <KeyType,EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType,EventType> register(@Nonnull EventPriority priority, @Nonnull Class<? super EventType> eventClass, @Nonnull KeyType key, @Nonnull Consumer<EventType> consumer) - Specified by:
registerin interfaceIEventRegistry
-
register
public <KeyType,EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType,EventType> register(short priority, @Nonnull Class<? super EventType> eventClass, @Nullable KeyType key, @Nonnull Consumer<EventType> consumer) - Specified by:
registerin interfaceIEventRegistry
-
registerAsync
public <EventType extends IAsyncEvent<Void>> EventRegistration<Void,EventType> registerAsync(@Nonnull Class<? super EventType> eventClass, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) - Specified by:
registerAsyncin interfaceIEventRegistry
-
registerAsync
public <EventType extends IAsyncEvent<Void>> EventRegistration<Void,EventType> registerAsync(@Nonnull EventPriority priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) - Specified by:
registerAsyncin interfaceIEventRegistry
-
registerAsync
public <EventType extends IAsyncEvent<Void>> EventRegistration<Void,EventType> registerAsync(short priority, Class<? super EventType> eventClass, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) - Specified by:
registerAsyncin interfaceIEventRegistry
-
registerAsync
public <KeyType,EventType extends IAsyncEvent<KeyType>> EventRegistration<KeyType,EventType> registerAsync(@Nonnull Class<? super EventType> eventClass, @Nonnull KeyType key, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) - Specified by:
registerAsyncin interfaceIEventRegistry
-
registerAsync
public <KeyType,EventType extends IAsyncEvent<KeyType>> EventRegistration<KeyType,EventType> registerAsync(@Nonnull EventPriority priority, Class<? super EventType> eventClass, @Nonnull KeyType key, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) - Specified by:
registerAsyncin interfaceIEventRegistry
-
registerAsync
public <KeyType,EventType extends IAsyncEvent<KeyType>> EventRegistration<KeyType,EventType> registerAsync(short priority, @Nonnull Class<? super EventType> eventClass, @Nullable KeyType key, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) - Specified by:
registerAsyncin interfaceIEventRegistry
-
registerGlobal
public <KeyType,EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType,EventType> registerGlobal(@Nonnull Class<? super EventType> eventClass, @Nonnull Consumer<EventType> consumer) - Specified by:
registerGlobalin interfaceIEventRegistry
-
registerGlobal
public <KeyType,EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType,EventType> registerGlobal(@Nonnull EventPriority priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Consumer<EventType> consumer) - Specified by:
registerGlobalin interfaceIEventRegistry
-
registerGlobal
public <KeyType,EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType,EventType> registerGlobal(short priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Consumer<EventType> consumer) - Specified by:
registerGlobalin interfaceIEventRegistry
-
registerAsyncGlobal
public <KeyType,EventType extends IAsyncEvent<KeyType>> EventRegistration<KeyType,EventType> registerAsyncGlobal(@Nonnull Class<? super EventType> eventClass, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) - Specified by:
registerAsyncGlobalin interfaceIEventRegistry
-
registerAsyncGlobal
public <KeyType,EventType extends IAsyncEvent<KeyType>> EventRegistration<KeyType,EventType> registerAsyncGlobal(@Nonnull EventPriority priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) - Specified by:
registerAsyncGlobalin interfaceIEventRegistry
-
registerAsyncGlobal
public <KeyType,EventType extends IAsyncEvent<KeyType>> EventRegistration<KeyType,EventType> registerAsyncGlobal(short priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) - Specified by:
registerAsyncGlobalin interfaceIEventRegistry
-
registerUnhandled
public <KeyType,EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType,EventType> registerUnhandled(@Nonnull Class<? super EventType> eventClass, @Nonnull Consumer<EventType> consumer) - Specified by:
registerUnhandledin interfaceIEventRegistry
-
registerUnhandled
public <KeyType,EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType,EventType> registerUnhandled(@Nonnull EventPriority priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Consumer<EventType> consumer) - Specified by:
registerUnhandledin interfaceIEventRegistry
-
registerUnhandled
public <KeyType,EventType extends IBaseEvent<KeyType>> EventRegistration<KeyType,EventType> registerUnhandled(short priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Consumer<EventType> consumer) - Specified by:
registerUnhandledin interfaceIEventRegistry
-
registerAsyncUnhandled
public <KeyType,EventType extends IAsyncEvent<KeyType>> EventRegistration<KeyType,EventType> registerAsyncUnhandled(@Nonnull Class<? super EventType> eventClass, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) - Specified by:
registerAsyncUnhandledin interfaceIEventRegistry
-
registerAsyncUnhandled
public <KeyType,EventType extends IAsyncEvent<KeyType>> EventRegistration<KeyType,EventType> registerAsyncUnhandled(@Nonnull EventPriority priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) - Specified by:
registerAsyncUnhandledin interfaceIEventRegistry
-
registerAsyncUnhandled
public <KeyType,EventType extends IAsyncEvent<KeyType>> EventRegistration<KeyType,EventType> registerAsyncUnhandled(short priority, @Nonnull Class<? super EventType> eventClass, @Nonnull Function<CompletableFuture<EventType>, CompletableFuture<EventType>> function) - Specified by:
registerAsyncUnhandledin interfaceIEventRegistry
-
dispatchFor
@Nonnull public <KeyType,EventType extends IEvent<KeyType>> IEventDispatcher<EventType,EventType> dispatchFor(@Nonnull Class<? super EventType> eventClass, KeyType key) - Specified by:
dispatchForin interfaceIEventBus
-
dispatchForAsync
@Nonnull public <KeyType,EventType extends IAsyncEvent<KeyType>> IEventDispatcher<EventType,CompletableFuture<EventType>> dispatchForAsync(@Nonnull Class<? super EventType> eventClass, KeyType key) - Specified by:
dispatchForAsyncin interfaceIEventBus
-