package pw.yumc.injected.event;

import org.bukkit.OfflinePlayer;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;

/**
 * @author 喵♂呜
 */
public class SetOpEvent extends Event implements Cancellable {

    private static final HandlerList handlers = new HandlerList();
    private final OfflinePlayer offlinePlayer;
    private final boolean value;
    private boolean cancel = false;

    public static HandlerList getHandlerList() {
        return handlers;
    }

    public SetOpEvent(final OfflinePlayer offlinePlayer, final boolean value) {
        this.offlinePlayer = offlinePlayer;
        this.value = value;
    }

    @Override
    public HandlerList getHandlers() {
        return handlers;
    }

    /**
     * @return offlinePlayer
     */
    public OfflinePlayer getOfflinePlayer() {
        return offlinePlayer;
    }

    @Override
    public boolean isCancelled() {
        return cancel;
    }

    /**
     * @return value
     */
    public boolean isValue() {
        return value;
    }

    @Override
    public void setCancelled(final boolean arg0) {
        cancel = arg0;
    }

}
