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 10ab5d448..9361c6160 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/PlayerProfile.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/PlayerProfile.java @@ -92,7 +92,13 @@ public class PlayerProfile implements OfflinePlayer { long threeWeeksAgo = date - 3L * week; long activePlayThreshold = Settings.ACTIVE_PLAY_THRESHOLD.getNumber() * TimeAmount.MINUTE.ms(); + if (activePlayThreshold <= 0) { + activePlayThreshold = 1; + } int activeLoginThreshold = Settings.ACTIVE_LOGIN_THRESHOLD.getNumber(); + if (activeLoginThreshold <= 0) { + activeLoginThreshold = 1; + } List sessionsWeek = getSessions(weekAgo, date).collect(Collectors.toList()); List sessionsWeek2 = getSessions(twoWeeksAgo, weekAgo).collect(Collectors.toList()); diff --git a/Plan/src/main/java/com/djrapitops/plan/data/ServerProfile.java b/Plan/src/main/java/com/djrapitops/plan/data/ServerProfile.java index b60647123..b5a51f825 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/ServerProfile.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/ServerProfile.java @@ -169,7 +169,9 @@ public class ServerProfile { } public double getNewPlayersPerDay(long after, long before) { - return getNewPlayers(after, before) * 1.0 / AnalysisUtils.getNumberOfDaysBetween(after, before); + long days = AnalysisUtils.getNumberOfDaysBetween(after, before); + long newPlayers = getNewPlayers(after, before); + return days == 0 ? newPlayers : newPlayers * 1.0 / days; } public Stream getPlayersWhoPlayedBetween(long after, long before) {