diff --git a/Plan/src/main/java/com/djrapitops/plan/data/PlayerProfile.java b/Plan/src/main/java/com/djrapitops/plan/data/PlayerProfile.java index 7ee8a0517..999404cf5 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/PlayerProfile.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/PlayerProfile.java @@ -438,6 +438,10 @@ public class PlayerProfile { return sessions.mapToLong(Session::getAfkLength).sum(); } + public static long getActivePlaytime(Stream sessions) { + return sessions.mapToLong(Session::getActiveLength).sum(); + } + public void calculateWorldTimesPerServer() { if (worldTimesMap.containsKey(ServerInfo.getServerUUID())) { return; diff --git a/Plan/src/main/java/com/djrapitops/plan/data/calculation/ActivityIndex.java b/Plan/src/main/java/com/djrapitops/plan/data/calculation/ActivityIndex.java index 9b26a6ce8..eac36855c 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/calculation/ActivityIndex.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/calculation/ActivityIndex.java @@ -45,17 +45,17 @@ public class ActivityIndex { // Playtime per week multipliers, max out to avoid too high values. double max = 4.0; - long playtimeWeek = PlayerProfile.getPlaytime(sessionsWeek.stream()); + long playtimeWeek = PlayerProfile.getActivePlaytime(sessionsWeek.stream()); double weekPlay = (playtimeWeek * 1.0 / activePlayThreshold); if (weekPlay > max) { weekPlay = max; } - long playtimeWeek2 = PlayerProfile.getPlaytime(sessionsWeek2.stream()); + long playtimeWeek2 = PlayerProfile.getActivePlaytime(sessionsWeek2.stream()); double week2Play = (playtimeWeek2 * 1.0 / activePlayThreshold); if (week2Play > max) { week2Play = max; } - long playtimeWeek3 = PlayerProfile.getPlaytime(sessionsWeek3.stream()); + long playtimeWeek3 = PlayerProfile.getActivePlaytime(sessionsWeek3.stream()); double week3Play = (playtimeWeek3 * 1.0 / activePlayThreshold); if (week3Play > max) { week3Play = max;