From 96f034da9f3a27f17688db81b9510a2c9b879f6f Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Fri, 27 Oct 2017 19:26:11 +0300 Subject: [PATCH] One missing world color consistency addition --- .../systems/info/parsing/InspectPageParser.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Plan/src/main/java/com/djrapitops/plan/systems/info/parsing/InspectPageParser.java b/Plan/src/main/java/com/djrapitops/plan/systems/info/parsing/InspectPageParser.java index 74c28cf61..245817a6b 100644 --- a/Plan/src/main/java/com/djrapitops/plan/systems/info/parsing/InspectPageParser.java +++ b/Plan/src/main/java/com/djrapitops/plan/systems/info/parsing/InspectPageParser.java @@ -13,6 +13,8 @@ import main.java.com.djrapitops.plan.data.Action; import main.java.com.djrapitops.plan.data.PlayerKill; import main.java.com.djrapitops.plan.data.Session; import main.java.com.djrapitops.plan.data.UserInfo; +import main.java.com.djrapitops.plan.data.time.GMTimes; +import main.java.com.djrapitops.plan.data.time.WorldTimes; import main.java.com.djrapitops.plan.database.Database; import main.java.com.djrapitops.plan.database.tables.SessionsTable; import main.java.com.djrapitops.plan.database.tables.UsersTable; @@ -154,7 +156,18 @@ public class InspectPageParser extends PageParser { addValue("playtimeTotal", FormatUtils.formatTimeAmount(playTime)); String punchCardData = PunchCardGraphCreator.createDataSeries(allSessions); - String[] worldPieData = WorldPieCreator.createSeriesData(db.getWorldTimesTable().getWorldTimesOfUser(uuid)); + WorldTimes worldTimes = db.getWorldTimesTable().getWorldTimesOfUser(uuid); + + // Add 0 time for worlds not present. + Set nonZeroWorlds = worldTimes.getWorldTimes().keySet(); + for (String world : db.getWorldTable().getWorlds()) { + if (nonZeroWorlds.contains(world)) { + continue; + } + worldTimes.setGMTimesForWorld(world, new GMTimes()); + } + + String[] worldPieData = WorldPieCreator.createSeriesData(worldTimes); addValue("worldPieSeries", worldPieData[0]); addValue("gmSeries", worldPieData[1]);