diff options
author | snowleo <schneeleo@gmail.com> | 2012-10-14 00:35:24 +0200 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2012-10-14 00:35:24 +0200 |
commit | 9ca4f53c1aad758a5183b0b54e64d8f6993b73ea (patch) | |
tree | 56ef2f1c005b42a1b5aeec2169c7c02a5a3cebf7 /EssentialsGeoIP/src/net/ess3/geoip | |
parent | eca8b54ef595e543c5ba9a94cc1b62e0c62a64d4 (diff) | |
download | Essentials-9ca4f53c1aad758a5183b0b54e64d8f6993b73ea.tar Essentials-9ca4f53c1aad758a5183b0b54e64d8f6993b73ea.tar.gz Essentials-9ca4f53c1aad758a5183b0b54e64d8f6993b73ea.tar.lz Essentials-9ca4f53c1aad758a5183b0b54e64d8f6993b73ea.tar.xz Essentials-9ca4f53c1aad758a5183b0b54e64d8f6993b73ea.zip |
replace user.isHidden() with player.canSee()
Diffstat (limited to 'EssentialsGeoIP/src/net/ess3/geoip')
-rw-r--r-- | EssentialsGeoIP/src/net/ess3/geoip/EssentialsGeoIPPlayerListener.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/EssentialsGeoIP/src/net/ess3/geoip/EssentialsGeoIPPlayerListener.java b/EssentialsGeoIP/src/net/ess3/geoip/EssentialsGeoIPPlayerListener.java index e7b3fe85e..d899ed972 100644 --- a/EssentialsGeoIP/src/net/ess3/geoip/EssentialsGeoIPPlayerListener.java +++ b/EssentialsGeoIP/src/net/ess3/geoip/EssentialsGeoIPPlayerListener.java @@ -45,8 +45,7 @@ public class EssentialsGeoIPPlayerListener implements Listener, IReload @EventHandler(priority = EventPriority.MONITOR) public void onPlayerJoin(final PlayerJoinEvent event) { - final IUser u = ess.getUserMap().getUser(event.getPlayer()); - if (Permissions.GEOIP_HIDE.isAuthorized(u)) + if (Permissions.GEOIP_HIDE.isAuthorized(event.getPlayer())) { return; } @@ -81,17 +80,21 @@ public class EssentialsGeoIPPlayerListener implements Listener, IReload } if (config.getData().isShowOnWhois()) { + final IUser u = ess.getUserMap().getUser(event.getPlayer()); u.getData().setGeolocation(builder.toString()); u.queueSave(); } - if (config.getData().isShowOnLogin() && !u.isHidden()) + if (config.getData().isShowOnLogin()) { for (Player player : event.getPlayer().getServer().getOnlinePlayers()) { - final IUser user = ess.getUserMap().getUser(player); - if (Permissions.GEOIP_SHOW.isAuthorized(user)) + if (!player.canSee(event.getPlayer())) { - user.sendMessage(_("geoipJoinFormat", user.getPlayer().getDisplayName(), builder.toString())); + continue; + } + if (Permissions.GEOIP_SHOW.isAuthorized(player)) + { + player.sendMessage(_("geoipJoinFormat", player.getDisplayName(), builder.toString())); } } } |