Class CustomEvent<T>
java.lang.Object
dev.scsupercraft.mc.libraries.corelib.api.event.CustomEvent<T>
- Type Parameters:
T- The type of event.
- All Implemented Interfaces:
dev.architectury.event.Event<T>
@AvailableSince("1.0.0")
public class CustomEvent<T>
extends Object
implements dev.architectury.event.Event<T>
An event wrapper that takes a runnable, which is called when a listener is added or removed.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCustomEvent(dev.architectury.event.Event<T> event, Runnable onRefresh) Creates a new custom event. -
Method Summary
Modifier and TypeMethodDescriptionvoidinvoker()booleanisRegistered(T listener) voidvoidunregister(T listener)
-
Field Details
-
event
The event to listen to. -
onRefresh
The function to run when an event listener is added or removed.
-
-
Constructor Details
-
Method Details
-
invoker
- Specified by:
invokerin interfacedev.architectury.event.Event<T>
-
register
- Specified by:
registerin interfacedev.architectury.event.Event<T>
-
unregister
- Specified by:
unregisterin interfacedev.architectury.event.Event<T>
-
isRegistered
- Specified by:
isRegisteredin interfacedev.architectury.event.Event<T>
-
clearListeners
public void clearListeners()- Specified by:
clearListenersin interfacedev.architectury.event.Event<T>
-