From ec3d2eba0272096fce04a76c17a6127e228913eb Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Mon, 27 Nov 2017 12:22:37 +0200 Subject: [PATCH] isEmpty addition --- .../plan/kingdoms/KingdomsData.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/PlanPluginBridge/src/main/java/com/djrapitops/pluginbridge/plan/kingdoms/KingdomsData.java b/PlanPluginBridge/src/main/java/com/djrapitops/pluginbridge/plan/kingdoms/KingdomsData.java index 0ad11e704..3db0a3429 100644 --- a/PlanPluginBridge/src/main/java/com/djrapitops/pluginbridge/plan/kingdoms/KingdomsData.java +++ b/PlanPluginBridge/src/main/java/com/djrapitops/pluginbridge/plan/kingdoms/KingdomsData.java @@ -57,16 +57,19 @@ public class KingdomsData extends PluginData { Map kingdoms = GameManagement.getKingdomManager().getKingdomList(); analysisContainer.addValue(getWithIcon("Kingdoms", "shield", "amber"), kingdoms.size()); - analysisContainer.addHtml("kingdomsAccordion", KingdomAccordionCreator.createAccordion(kingdoms)); - Map userKingDoms = new HashMap<>(); - for (Map.Entry entry : kingdoms.entrySet()) { - String kingdom = entry.getKey(); - for (UUID member : entry.getValue().getMembersList()) { - userKingDoms.put(member, kingdom); + if (!kingdoms.isEmpty()) { + analysisContainer.addHtml("kingdomsAccordion", KingdomAccordionCreator.createAccordion(kingdoms)); + + Map userKingDoms = new HashMap<>(); + for (Map.Entry 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; }