- Add proper javadoc to all events - Use proper handling of the Eventlist in all events: each event has its own EventList and its static method, as specified by Bukkit's Event class - Add common supertype to all AuthMe events - Remove unused events - Remove unused methods (setters to fields that we ignore entirely)
53 lines
1.4 KiB
Java
53 lines
1.4 KiB
Java
package fr.xephi.authme.events;
|
|
|
|
import org.bukkit.Location;
|
|
import org.bukkit.entity.Player;
|
|
import org.bukkit.event.Event;
|
|
import org.bukkit.event.HandlerList;
|
|
|
|
/**
|
|
* Called if a player is teleported to a specific spawn upon joining or logging in.
|
|
*/
|
|
public class SpawnTeleportEvent extends AbstractTeleportEvent {
|
|
|
|
private static final HandlerList handlers = new HandlerList();
|
|
private final boolean isAuthenticated;
|
|
|
|
/**
|
|
* Constructor.
|
|
*
|
|
* @param player The player
|
|
* @param from The location the player is being teleported away from
|
|
* @param to The teleport destination
|
|
* @param isAuthenticated Whether or not the player is logged in
|
|
*/
|
|
public SpawnTeleportEvent(Player player, Location from, Location to, boolean isAuthenticated) {
|
|
super(false, player, from, to);
|
|
this.isAuthenticated = isAuthenticated;
|
|
}
|
|
|
|
/**
|
|
* Return whether or not the player is authenticated.
|
|
*
|
|
* @return true if the player is logged in, false otherwise
|
|
*/
|
|
public boolean isAuthenticated() {
|
|
return isAuthenticated;
|
|
}
|
|
|
|
/**
|
|
* 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;
|
|
}
|
|
|
|
}
|