public final class Events extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
call(org.bukkit.event.Event event)
Submit the event on the current thread
|
static <T extends org.bukkit.event.Event> |
callAndReturn(T event)
Submit the event on the current thread
|
static void |
callAsync(org.bukkit.event.Event event)
Submit the event on a new async thread.
|
static <T extends org.bukkit.event.Event> |
callAsyncAndJoin(T event)
Submit the event on a new async thread.
|
static void |
callSync(org.bukkit.event.Event event)
Submit the event on the main server thread.
|
static <T extends org.bukkit.event.Event> |
callSyncAndJoin(T event)
Submit the event on the main server thread.
|
static <S extends org.bukkit.event.Event> |
merge(Class<S> superClass,
Class<? extends S>... eventClasses)
Makes a MergedSubscriptionBuilder for a super event class
|
static <S extends org.bukkit.event.Event> |
merge(Class<S> superClass,
org.bukkit.event.EventPriority priority,
Class<? extends S>... eventClasses)
Makes a MergedSubscriptionBuilder for a super event class
|
static <T> MergedSubscriptionBuilder<T> |
merge(Class<T> handledClass)
Makes a MergedSubscriptionBuilder for a given super type
|
static <T> MergedSubscriptionBuilder<T> |
merge(com.google.common.reflect.TypeToken<T> type)
Makes a MergedSubscriptionBuilder for a given super type
|
static <T extends org.bukkit.event.Event> |
subscribe(Class<T> eventClass)
Makes a SingleSubscriptionBuilder for a given event
|
static <T extends org.bukkit.event.Event> |
subscribe(Class<T> eventClass,
org.bukkit.event.EventPriority priority)
Makes a SingleSubscriptionBuilder for a given event
|
@Nonnull public static <T extends org.bukkit.event.Event> SingleSubscriptionBuilder<T> subscribe(@Nonnull Class<T> eventClass)
T - the event typeeventClass - the class of the eventSingleSubscriptionBuilder to construct the event handlerNullPointerException - if eventClass is null@Nonnull public static <T extends org.bukkit.event.Event> SingleSubscriptionBuilder<T> subscribe(@Nonnull Class<T> eventClass, @Nonnull org.bukkit.event.EventPriority priority)
T - the event typeeventClass - the class of the eventpriority - the priority to listen atSingleSubscriptionBuilder to construct the event handlerNullPointerException - if eventClass or priority is null@Nonnull public static <T> MergedSubscriptionBuilder<T> merge(@Nonnull Class<T> handledClass)
T - the super type classhandledClass - the super type of the event handlerMergedSubscriptionBuilder to construct the event handler@Nonnull public static <T> MergedSubscriptionBuilder<T> merge(@Nonnull com.google.common.reflect.TypeToken<T> type)
T - the super type classtype - the super type of the event handlerMergedSubscriptionBuilder to construct the event handler@Nonnull @SafeVarargs public static <S extends org.bukkit.event.Event> MergedSubscriptionBuilder<S> merge(@Nonnull Class<S> superClass, @Nonnull Class<? extends S>... eventClasses)
S - the super class typesuperClass - the abstract super event classeventClasses - the event classes to be bound toMergedSubscriptionBuilder to construct the event handler@Nonnull @SafeVarargs public static <S extends org.bukkit.event.Event> MergedSubscriptionBuilder<S> merge(@Nonnull Class<S> superClass, @Nonnull org.bukkit.event.EventPriority priority, @Nonnull Class<? extends S>... eventClasses)
S - the super class typesuperClass - the abstract super event classpriority - the priority to listen ateventClasses - the event classes to be bound toMergedSubscriptionBuilder to construct the event handlerpublic static void call(@Nonnull org.bukkit.event.Event event)
event - the event to callpublic static void callAsync(@Nonnull org.bukkit.event.Event event)
event - the event to callpublic static void callSync(@Nonnull org.bukkit.event.Event event)
event - the event to call@Nonnull public static <T extends org.bukkit.event.Event> T callAndReturn(@Nonnull T event)
event - the event to call@Nonnull public static <T extends org.bukkit.event.Event> T callAsyncAndJoin(@Nonnull T event)
event - the event to callCopyright © 2022. All rights reserved.