org.bukkit.event.player
Class AsyncPlayerPreLoginEvent

java.lang.Object
  extended by org.bukkit.event.Event
      extended by org.bukkit.event.player.AsyncPlayerPreLoginEvent

public class AsyncPlayerPreLoginEvent
extends Event

Stores details for players attempting to log in.
This event is asynchronous, and not run using main thread.


Nested Class Summary
static class AsyncPlayerPreLoginEvent.Result
          Basic kick reasons for communicating to plugins
 
Constructor Summary
AsyncPlayerPreLoginEvent(String name, InetAddress ipAddress)
           
 
Method Summary
 void allow()
          Allows the player to log in
 void disallow(AsyncPlayerPreLoginEvent.Result result, String message)
          Disallows the player from logging in, with the given reason
 void disallow(PlayerPreLoginEvent.Result result, String message)
          Deprecated. This method uses a deprecated enum from PlayerPreLoginEvent
 InetAddress getAddress()
          Gets the player IP address.
static HandlerList getHandlerList()
           
 HandlerList getHandlers()
           
 String getKickMessage()
          Gets the current kick message that will be used if getResult() != Result.ALLOWED
 AsyncPlayerPreLoginEvent.Result getLoginResult()
          Gets the current result of the login, as an enum
 String getName()
          Gets the player's name.
 PlayerPreLoginEvent.Result getResult()
          Deprecated. This method uses a deprecated enum from PlayerPreLoginEvent
 void setKickMessage(String message)
          Sets the kick message to display if getResult() != Result.ALLOWED
 void setLoginResult(AsyncPlayerPreLoginEvent.Result result)
          Sets the new result of the login, as an enum
 void setResult(PlayerPreLoginEvent.Result result)
          Deprecated. This method uses a deprecated enum from PlayerPreLoginEvent
 
Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsyncPlayerPreLoginEvent

public AsyncPlayerPreLoginEvent(String name,
                                InetAddress ipAddress)
Method Detail

getLoginResult

public AsyncPlayerPreLoginEvent.Result getLoginResult()
Gets the current result of the login, as an enum

Returns:
Current Result of the login

getResult

@Deprecated
public PlayerPreLoginEvent.Result getResult()
Deprecated. This method uses a deprecated enum from PlayerPreLoginEvent

Gets the current result of the login, as an enum

Returns:
Current Result of the login
See Also:
getLoginResult()

setLoginResult

public void setLoginResult(AsyncPlayerPreLoginEvent.Result result)
Sets the new result of the login, as an enum

Parameters:
result - New result to set

setResult

@Deprecated
public void setResult(PlayerPreLoginEvent.Result result)
Deprecated. This method uses a deprecated enum from PlayerPreLoginEvent

Sets the new result of the login, as an enum

Parameters:
result - New result to set
See Also:
setLoginResult(Result)

getKickMessage

public String getKickMessage()
Gets the current kick message that will be used if getResult() != Result.ALLOWED

Returns:
Current kick message

setKickMessage

public void setKickMessage(String message)
Sets the kick message to display if getResult() != Result.ALLOWED

Parameters:
message - New kick message

allow

public void allow()
Allows the player to log in


disallow

public void disallow(AsyncPlayerPreLoginEvent.Result result,
                     String message)
Disallows the player from logging in, with the given reason

Parameters:
result - New result for disallowing the player
message - Kick message to display to the user

disallow

@Deprecated
public void disallow(PlayerPreLoginEvent.Result result,
                                String message)
Deprecated. This method uses a deprecated enum from PlayerPreLoginEvent

Disallows the player from logging in, with the given reason

Parameters:
result - New result for disallowing the player
message - Kick message to display to the user
See Also:
disallow(Result, String)

getName

public String getName()
Gets the player's name.

Returns:
the player's name

getAddress

public InetAddress getAddress()
Gets the player IP address.

Returns:
The IP address

getHandlers

public HandlerList getHandlers()
Specified by:
getHandlers in class Event

getHandlerList

public static HandlerList getHandlerList()


Copyright © 2013. All Rights Reserved.