io.github.dailystruggle.rtp.bukkit.events.PreSetupTeleportEvent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of RTP Show documentation
Show all versions of RTP Show documentation
a random teleport plugin
package io.github.dailystruggle.rtp.bukkit.events;
import io.github.dailystruggle.rtp.common.tasks.teleport.SetupTeleport;
import org.bukkit.Bukkit;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class PreSetupTeleportEvent extends Event implements Cancellable {
private static final HandlerList HANDLERS_LIST = new HandlerList();
private final SetupTeleport setupTeleport;
private boolean cancelled = false;
public PreSetupTeleportEvent(SetupTeleport setupTeleport) {
super(!Bukkit.isPrimaryThread());
this.setupTeleport = setupTeleport;
}
public static HandlerList getHandlerList() {
return HANDLERS_LIST;
}
@Override
public @NotNull HandlerList getHandlers() {
return HANDLERS_LIST;
}
@Override
public boolean isCancelled() {
return cancelled;
}
@Override
public void setCancelled(boolean cancel) {
cancelled = cancel;
}
public SetupTeleport getSetupTeleport() {
return setupTeleport;
}
}