Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<Town> townsToCheck = TownyUniverse.getDataSource().getTowns();
- List<Town> townsToCount = TownyUniverse.getDataSource().getTowns();
- Integer topResidents = 0;
- while (townsToCount.size() > 0) {
- for (Town town: townsToCount) {
- if (town.getNumResidents() >= topResidents) {
- topResidents = town.getNumResidents();
- }
- }
- //player.sendMessage(topresidents.toString());
- for (Town town: townsToCheck) {
- //player.sendMessage(town.getName());
- if (town.getNumResidents() >= topResidents) {
- townsToCheck.remove(town);
- townsToCount.remove(town);
- String output = Colors.LightBlue + town.getName() + Colors.Gray + " - " + Colors.Blue + "(" + town.getNumResidents() + ")";
- if (town.isOpen())
- output += Colors.White + " (Open)";
- //formatedList.add(output);
- player.sendMessage(output);
- player.sendMessage("Remaining Towns: " + townsToCount.size());
- }
- }
- topResidents = 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement