Class EventInvokerImpl<T>
java.lang.Object
net.ixdarklord.coolcatcore.internal.event.EventInvokerImpl<T>
- All Implemented Interfaces:
EventInvoker<T>
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> EventInvoker<T> booleaninvoker()Fires the event: calls every listener as the event combines them.static <T> EventInvoker<T> voidregister(EventPhase phase, T listener) Adds a listener in the given phase.type()The listener type identifying this event.booleanunregister(T listener) Removes a listener, from whichever phase it was added to.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EventInvoker
register
-
Method Details
-
create
public static <T> EventInvoker<T> create(Class<T> type, @Nullable @Nullable Function<List<T>, T> combiner) -
lookup
-
type
Description copied from interface:EventInvokerThe listener type identifying this event.- Specified by:
typein interfaceEventInvoker<T>
-
register
Description copied from interface:EventInvokerAdds a listener in the given phase.- Specified by:
registerin interfaceEventInvoker<T>
-
unregister
Description copied from interface:EventInvokerRemoves a listener, from whichever phase it was added to.- Specified by:
unregisterin interfaceEventInvoker<T>- Returns:
- whether it was registered
-
hasListeners
public boolean hasListeners()- Specified by:
hasListenersin interfaceEventInvoker<T>- Returns:
- whether the event has any listeners, so a loader can skip building its arguments
-
invoker
Description copied from interface:EventInvokerFires the event: calls every listener as the event combines them.- Specified by:
invokerin interfaceEventInvoker<T>
-