From eb00a94c8891a279b17ed482d777ee3a37d470c4 Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Thu, 10 Aug 2017 20:38:00 +0300 Subject: [PATCH] Fix #227 (Removed exception throw) --- .../java/com/djrapitops/plan/data/time/TimeKeeper.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Plan/src/main/java/com/djrapitops/plan/data/time/TimeKeeper.java b/Plan/src/main/java/com/djrapitops/plan/data/time/TimeKeeper.java index 33e45499c..50c312a04 100644 --- a/Plan/src/main/java/com/djrapitops/plan/data/time/TimeKeeper.java +++ b/Plan/src/main/java/com/djrapitops/plan/data/time/TimeKeeper.java @@ -70,9 +70,9 @@ public abstract class TimeKeeper { */ public void changeState(String newState, long playTime) throws IllegalArgumentException, IllegalStateException { Verify.nullCheck(newState); - if (playTime < lastStateChange) { - throw new IllegalStateException("Given Playtime is lower than last status change time: " + playTime + " / " + lastStateChange); - } +// if (playTime < lastStateChange) { +// throw new IllegalStateException("Given Playtime is lower than last status change time: " + playTime + " / " + lastStateChange); +// } if (state == null) { state = newState; } @@ -81,7 +81,7 @@ public abstract class TimeKeeper { currentTime = 0L; } long diff = playTime - lastStateChange; - times.put(state, currentTime + diff); + times.put(state, currentTime + Math.abs(diff)); state = newState; lastStateChange = playTime; }