if (args.size() == 1) {
if (args.get(0).equalsIgnoreCase("--all") || args.get(0).equalsIgnoreCase("-a")) {
showAll = true;
} else {
// single world mode
MultiverseWorld world = this.worldManager.getMVWorld(args.get(0));
if (world == null) {
sender.sendMessage(ChatColor.RED + "That world does not exist.");
return;
}
if (!this.plugin.getMVPerms().canEnterWorld(p, world)) {
sender.sendMessage(ChatColor.RED + "You aren't allowed to access to this world!");
return;
}
sender.sendMessage(String.format("%s--- Players in %s%s ---", ChatColor.AQUA,
world.getColoredWorldString(), ChatColor.AQUA));
sender.sendMessage(this.buildPlayerString(world, p, visiblePlayers));
return;
}
}
// multiworld mode
sender.sendMessage(ChatColor.AQUA + "--- Worlds and their players --- "
+ visiblePlayers.size() + "/" + plugin.getServer().getMaxPlayers());
boolean shownOne = false;
for (MultiverseWorld world : this.worldManager.getMVWorlds()) {
if (this.plugin.getMVPerms().canEnterWorld(p, world)) { // only show world if the player can access it
if (showAll || !world.getCBWorld().getPlayers().isEmpty()) { // either show all or show if the world is not empty
sender.sendMessage(String.format("%s%s - %s", world.getColoredWorldString(), ChatColor.WHITE, buildPlayerString(world, p, visiblePlayers)));
shownOne = true;
}
}
}
if (!shownOne) {