diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_list.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_list.java
index 402be4ab..f3a0ad94 100644
--- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_list.java
+++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_list.java
@@ -101,7 +101,8 @@ public class Command_list extends FreedomCommand
}
else
{
- onlineStats.append(ChatColor.BLUE).append("There are ").append(ChatColor.RED).append(server.getOnlinePlayers().size() - AdminList.vanished.size())
+ int count = server.getOnlinePlayers().size() - AdminList.vanished.size();
+ onlineStats.append(ChatColor.BLUE).append("There are ").append(ChatColor.RED).append(count < 0 ? 0 : count)
.append(ChatColor.BLUE)
.append(" out of a maximum ")
.append(ChatColor.RED)
diff --git a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_list.java b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_list.java
index 81333e4b..ef40114c 100644
--- a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_list.java
+++ b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_list.java
@@ -88,6 +88,8 @@ public class Module_list extends HTTPDModule
}
}
+ int count = server.getOnlinePlayers().size() - AdminList.vanished.size();
+
// for future refernce - any multi-worded ranks are to be delimited by underscores in the json; eg. senior_admins
responseObject.put("owners", owners);
responseObject.put("executives", executives);
@@ -97,7 +99,7 @@ public class Module_list extends HTTPDModule
responseObject.put("master_builders", masterbuilders);
responseObject.put("operators", operators);
responseObject.put("imposters", imposters);
- responseObject.put("online", server.getOnlinePlayers().size() - AdminList.vanished.size());
+ responseObject.put("online", count < 0 ? 0 : count);
responseObject.put("max", server.getMaxPlayers());
final NanoHTTPD.Response response = new NanoHTTPD.Response(NanoHTTPD.Response.Status.OK, NanoHTTPD.MIME_JSON, responseObject.toString());
@@ -110,7 +112,8 @@ public class Module_list extends HTTPDModule
final Collection extends Player> onlinePlayers = Bukkit.getOnlinePlayers();
- body.append("There are ").append(onlinePlayers.size() - AdminList.vanished.size()).append("/")
+ int count = onlinePlayers.size() - AdminList.vanished.size();
+ body.append("
There are ").append(count < 0 ? 0 : count).append("/")
.append(Bukkit.getMaxPlayers()).append(" players online:
\r\n");
body.append("