net.minestom.server.event.EventDispatcher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of minestom-snapshots Show documentation
Show all versions of minestom-snapshots Show documentation
1.20.4 Lightweight Minecraft server
package net.minestom.server.event;
import net.minestom.server.MinecraftServer;
import net.minestom.server.event.trait.CancellableEvent;
import org.jetbrains.annotations.NotNull;
public final class EventDispatcher {
public static void call(@NotNull Event event) {
MinecraftServer.getGlobalEventHandler().call(event);
}
public static ListenerHandle getHandle(@NotNull Class handleType) {
return MinecraftServer.getGlobalEventHandler().getHandle(handleType);
}
public static void callCancellable(@NotNull CancellableEvent event, @NotNull Runnable successCallback) {
MinecraftServer.getGlobalEventHandler().callCancellable(event, successCallback);
}
}