All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.dailystruggle.rtp.bukkit.events.PreSetupTeleportEvent Maven / Gradle / Ivy

There is a newer version: 2.0.15
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy