isEmpty addition

This commit is contained in:
Rsl1122 2017-11-27 12:22:37 +02:00
parent 46ea5ccc6e
commit ec3d2eba02

View File

@ -57,16 +57,19 @@ public class KingdomsData extends PluginData {
Map<String, OfflineKingdom> kingdoms = GameManagement.getKingdomManager().getKingdomList(); Map<String, OfflineKingdom> kingdoms = GameManagement.getKingdomManager().getKingdomList();
analysisContainer.addValue(getWithIcon("Kingdoms", "shield", "amber"), kingdoms.size()); analysisContainer.addValue(getWithIcon("Kingdoms", "shield", "amber"), kingdoms.size());
analysisContainer.addHtml("kingdomsAccordion", KingdomAccordionCreator.createAccordion(kingdoms));
Map<UUID, String> userKingDoms = new HashMap<>(); if (!kingdoms.isEmpty()) {
for (Map.Entry<String, OfflineKingdom> entry : kingdoms.entrySet()) { analysisContainer.addHtml("kingdomsAccordion", KingdomAccordionCreator.createAccordion(kingdoms));
String kingdom = entry.getKey();
for (UUID member : entry.getValue().getMembersList()) { Map<UUID, String> userKingDoms = new HashMap<>();
userKingDoms.put(member, kingdom); for (Map.Entry<String, OfflineKingdom> entry : kingdoms.entrySet()) {
String kingdom = entry.getKey();
for (UUID member : entry.getValue().getMembersList()) {
userKingDoms.put(member, kingdom);
}
} }
analysisContainer.addPlayerTableValues(getWithIcon("Kingdom", "shield"), userKingDoms);
} }
analysisContainer.addPlayerTableValues(getWithIcon("Kingdom", "shield"), userKingDoms);
return analysisContainer; return analysisContainer;
} }