类 ServerEvents
java.lang.Object
icu.suc.serverevents.ServerEvents
-
嵌套类概要
嵌套类修饰符和类型类说明static final classstatic final classstatic final classstatic final classstatic final classstatic final classstatic final classstatic final classstatic final classstatic final classstatic final classstatic final class -
方法概要
修饰符和类型方法说明static <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.
-
方法详细资料
-
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.- 类型参数:
T- the type of the event listener; eacheventexpects this type- 参数:
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.- 类型参数:
T- the type of the event listener; eacheventexpects this type- 参数:
phase- the registration phase to uselistener- the object to register; must implement each event's type parameterTevents- the events to register to
-