diff --git a/permissions.txt b/permissions.txt index 9b7e9007..324c5246 100644 --- a/permissions.txt +++ b/permissions.txt @@ -3,4 +3,4 @@ dynmap.fullrender # Issue a full render dynmap.hide.self # Hide self from map dynmap.hide.others # Hide others from map dynmap.show.self # Reveal self on map -dynmap.show.others # Reveal others on map \ No newline at end of file +dynmap.show.others # Reveal others on map diff --git a/src/main/java/org/dynmap/PlayerList.java b/src/main/java/org/dynmap/PlayerList.java index e2d784f4..3954264c 100644 --- a/src/main/java/org/dynmap/PlayerList.java +++ b/src/main/java/org/dynmap/PlayerList.java @@ -76,9 +76,10 @@ public class PlayerList { public Player[] getVisiblePlayers(String worldName) { ArrayList visiblePlayers = new ArrayList(); Player[] onlinePlayers = server.getOnlinePlayers(); + boolean useWhitelist = configuration.getBoolean("display-whitelist", false); for (int i = 0; i < onlinePlayers.length; i++) { Player p = onlinePlayers[i]; - if (p.getWorld().getName().equals(worldName) && !(configuration.getBoolean("display-whitelist", false) ^ hiddenPlayerNames.contains(p.getName().toLowerCase()))) { + if (p.getWorld().getName().equals(worldName) && !(useWhitelist ^ hiddenPlayerNames.contains(p.getName().toLowerCase()))) { visiblePlayers.add(p); } } @@ -90,9 +91,10 @@ public class PlayerList { public Player[] getVisiblePlayers() { ArrayList visiblePlayers = new ArrayList(); Player[] onlinePlayers = server.getOnlinePlayers(); + boolean useWhitelist = configuration.getBoolean("display-whitelist", false); for (int i = 0; i < onlinePlayers.length; i++) { Player p = onlinePlayers[i]; - if (!(configuration.getBoolean("display-whitelist", false) ^ hiddenPlayerNames.contains(p.getName().toLowerCase()))) { + if (!(useWhitelist ^ hiddenPlayerNames.contains(p.getName().toLowerCase()))) { visiblePlayers.add(p); } }