Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Less config checks in loop, added newline at EOF

  • Loading branch information...
commit 91b60be572cd005170a11ff18dd23511f9743010 1 parent 69fcc17
@zeeZ zeeZ authored
Showing with 5 additions and 3 deletions.
  1. +1 −1  permissions.txt
  2. +4 −2 src/main/java/org/dynmap/PlayerList.java
View
2  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
+dynmap.show.others # Reveal others on map
View
6 src/main/java/org/dynmap/PlayerList.java
@@ -76,9 +76,10 @@ public void setVisible(String playerName, boolean visible) {
public Player[] getVisiblePlayers(String worldName) {
ArrayList<Player> visiblePlayers = new ArrayList<Player>();
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 void setVisible(String playerName, boolean visible) {
public Player[] getVisiblePlayers() {
ArrayList<Player> visiblePlayers = new ArrayList<Player>();
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);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.