Remove redundant player IP lookup call.
This commit is contained in:
parent
5d2bb066b8
commit
114e94a50f
|
@ -1380,9 +1380,11 @@ public class PurpleIRC extends JavaPlugin {
|
|||
logError(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public String getPlayerHost(Player player) {
|
||||
final String playerIP = player.getAddress().getAddress().getHostAddress();
|
||||
|
||||
public String getPlayerHost(final String playerIP) {
|
||||
if (playerIP == null) {
|
||||
return "unknown";
|
||||
}
|
||||
if (hostCache.containsKey(playerIP)) {
|
||||
return hostCache.get(playerIP);
|
||||
} else {
|
||||
|
|
|
@ -548,7 +548,7 @@ public class ChatTokenizer {
|
|||
String group = plugin.getPlayerGroup(player);
|
||||
String displayName = player.getDisplayName();
|
||||
String playerIP = player.getAddress().getAddress().getHostAddress();
|
||||
String host = plugin.getPlayerHost(player);
|
||||
String host = plugin.getPlayerHost(playerIP);
|
||||
String worldName = "";
|
||||
String worldAlias = "";
|
||||
String worldColor = "";
|
||||
|
|
Loading…
Reference in New Issue