package fr.xephi.authme.events;

import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;

/**
 *
 * This event is called when a player login or register through AuthMe. The
 * boolean 'isLogin' will be false if, and only if, login/register failed.
 *
 * @author Xephi59
 */
public class LoginEvent extends Event {

	private static final HandlerList handlers = new HandlerList();
	private boolean isLogin;
	private Player player;

	public LoginEvent(Player player, boolean isLogin) {
		this.player = player;
		this.isLogin = isLogin;
	}

	public static HandlerList getHandlerList() {
		return handlers;
	}

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

	public Player getPlayer() {
		return this.player;
	}

	public boolean isLogin() {
		return isLogin;
	}

	@Deprecated
	public void setLogin(boolean isLogin) {
		this.isLogin = isLogin;
	}

	public void setPlayer(Player player) {
		this.player = player;
	}

}
