From da80921d5218ec73e0d4e227bae09b3dbd6e851e Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sat, 3 Mar 2012 12:39:14 -0600 Subject: [PATCH] [Bleeding] Added getting the hostname a player used to log in. Addresses BUKKIT-984 By: SpaceManiac --- .../org/bukkit/event/player/PlayerLoginEvent.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java b/paper-api/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java index 4b6ee79701..2a457da13b 100644 --- a/paper-api/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java @@ -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 */