#857 Create event for failed authentication

This commit is contained in:
ljacqu
2017-04-29 14:46:06 +02:00
parent dbb8ea7f38
commit d65556d893
5 changed files with 100 additions and 4 deletions
@@ -0,0 +1,45 @@
package fr.xephi.authme.events;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
* Event fired when a player enters a wrong password.
*/
public class FailedLoginEvent extends CustomEvent {
private static final HandlerList handlers = new HandlerList();
private final Player player;
/**
* Constructor.
*
* @param player The player
*/
public FailedLoginEvent(Player player, boolean isAsync) {
super(isAsync);
this.player = player;
}
/**
* @return The player entering a wrong password
*/
public Player getPlayer() {
return player;
}
/**
* Return the list of handlers, equivalent to {@link #getHandlers()} and required by {@link Event}.
*
* @return The list of handlers
*/
public static HandlerList getHandlerList() {
return handlers;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
}