Package icu.suc.mc.serverevents
Class ServerEvents
java.lang.Object
icu.suc.mc.serverevents.ServerEvents
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final classstatic final classstatic final classstatic final classstatic final classstatic final classstatic final classstatic final classstatic final classstatic final classstatic final class -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> voidregister(@NotNull Object listener, net.fabricmc.fabric.api.event.Event<? extends T> @NotNull ... events) Registers the given listener to one or more events using the default phase.static <T> voidregister(@NotNull net.minecraft.resources.Identifier phase, @NotNull Object listener, net.fabricmc.fabric.api.event.Event<? extends T> @NotNull ... events) Registers the given listener to one or more events with a specified phase.
-
Method Details
-
register
@SafeVarargs public static <T> void register(@NotNull @NotNull Object listener, net.fabricmc.fabric.api.event.Event<? extends T> @NotNull ... events) Registers the given listener to one or more events using the default phase.The
listenerobject must implement the interface or class represented by eachevent's type parameterT. Passing an incompatible object will throw aClassCastExceptionat runtime.This variant uses
Event.DEFAULT_PHASEas the registration phase.- Type Parameters:
T- the type of the event listener; eacheventexpects this type- Parameters:
listener- the object to register; must implement each event's type parameterTevents- the events to register to
-
register
@SafeVarargs public static <T> void register(@NotNull @NotNull net.minecraft.resources.Identifier phase, @NotNull @NotNull Object listener, net.fabricmc.fabric.api.event.Event<? extends T> @NotNull ... events) Registers the given listener to one or more events with a specified phase.The
listenerobject must implement the interface or class represented by eachevent's type parameterT. Passing an incompatible object will throw aClassCastExceptionat runtime.- Type Parameters:
T- the type of the event listener; eacheventexpects this type- Parameters:
phase- the registration phase to uselistener- the object to register; must implement each event's type parameterTevents- the events to register to
-