From cb6c8affa32b08e80e05e73e16d364cb4cc033bf Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Mon, 15 Apr 2019 08:45:46 +0300 Subject: [PATCH] Fixed data combining for Extension tabs - All aggregate data now displayed properly --- .../results/ExtensionTabData.java | 32 ++++++++++--------- Plan/extensions/build.gradle | 2 +- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/Plan/common/src/main/java/com/djrapitops/plan/extension/implementation/results/ExtensionTabData.java b/Plan/common/src/main/java/com/djrapitops/plan/extension/implementation/results/ExtensionTabData.java index 91cc29347..7ef1e5997 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/extension/implementation/results/ExtensionTabData.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/extension/implementation/results/ExtensionTabData.java @@ -113,6 +113,22 @@ public class ExtensionTabData implements Comparable { this.stringData.putAll(other.stringData); this.tableData.addAll(other.tableData); + + createOrderingList(); + } + + private void createOrderingList() { + List descriptives = new ArrayList<>(); + booleanData.values().stream().map(ExtensionData::getDescriptive).forEach(descriptives::add); + doubleData.values().stream().map(ExtensionData::getDescriptive).forEach(descriptives::add); + percentageData.values().stream().map(ExtensionData::getDescriptive).forEach(descriptives::add); + numberData.values().stream().map(ExtensionData::getDescriptive).forEach(descriptives::add); + stringData.values().stream().map(ExtensionData::getDescriptive).forEach(descriptives::add); + + order = descriptives.stream().sorted() + .map(ExtensionDescriptive::getName) + .distinct()// Method names are usually different, but in case someone had same method name with different parameters. + .collect(Collectors.toList()); } public static class Factory { @@ -153,22 +169,8 @@ public class ExtensionTabData implements Comparable { return this; } - private void createOrderingList() { - List descriptives = new ArrayList<>(); - data.booleanData.values().stream().map(ExtensionData::getDescriptive).forEach(descriptives::add); - data.doubleData.values().stream().map(ExtensionData::getDescriptive).forEach(descriptives::add); - data.percentageData.values().stream().map(ExtensionData::getDescriptive).forEach(descriptives::add); - data.numberData.values().stream().map(ExtensionData::getDescriptive).forEach(descriptives::add); - data.stringData.values().stream().map(ExtensionData::getDescriptive).forEach(descriptives::add); - - data.order = descriptives.stream().sorted() - .map(ExtensionDescriptive::getName) - .distinct()// Method names are usually different, but in case someone had same method name with different parameters. - .collect(Collectors.toList()); - } - public ExtensionTabData build() { - createOrderingList(); + data.createOrderingList(); Collections.sort(data.tableData); return data; } diff --git a/Plan/extensions/build.gradle b/Plan/extensions/build.gradle index 28566115a..a6538f20c 100644 --- a/Plan/extensions/build.gradle +++ b/Plan/extensions/build.gradle @@ -2,7 +2,7 @@ dependencies { compile project(path: ":api") compile "com.djrapitops:Extension-AdvancedAchievements:1.1-R0.2" compile "com.djrapitops:Extension-AdvancedBan:2.1.5-R0.5" - compile "com.djrapitops:Extension-ASkyBlock:3.0.9.4-R0.1" + compile "com.djrapitops:Extension-ASkyBlock:3.0.9.4-R0.2" compile "com.djrapitops:Extension-BanManager:5.15.0-R0.4" compile "com.djrapitops:Extension-CoreProtect:2.16.0-R0.2" compile "com.djrapitops:Extension-DiscordSRV:1.16.6-R0.2"