mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-17 21:33:49 -07: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:
@@ -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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user