mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-23 16:56:31 +01:00
[Bleeding] Added getting the hostname a player used to log in. Addresses BUKKIT-984
By: SpaceManiac <tad.hardesty@platymuus.com>
This commit is contained in:
parent
5e614ba44b
commit
da80921d52
1 changed files with 15 additions and 0 deletions
|
@ -10,11 +10,17 @@ public class PlayerLoginEvent extends PlayerEvent {
|
|||
private static final HandlerList handlers = new HandlerList();
|
||||
private Result result = Result.ALLOWED;
|
||||
private String message = "";
|
||||
private String hostname = "";
|
||||
|
||||
public PlayerLoginEvent(final Player player) {
|
||||
super(player);
|
||||
}
|
||||
|
||||
public PlayerLoginEvent(final Player player, final String hostname) {
|
||||
this(player);
|
||||
this.hostname = hostname;
|
||||
}
|
||||
|
||||
public PlayerLoginEvent(final Player player, final Result result, final String message) {
|
||||
this(player);
|
||||
this.result = result;
|
||||
|
@ -57,6 +63,15 @@ public class PlayerLoginEvent extends PlayerEvent {
|
|||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the hostname that the player used to connect to the server, or blank if unknown
|
||||
*
|
||||
* @return The hostname
|
||||
*/
|
||||
public String getHostname() {
|
||||
return hostname;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows the player to log in
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue