diff --git a/src/engine/workthreads/MineThread.java b/src/engine/workthreads/MineThread.java index f0e1f424..48c8756b 100644 --- a/src/engine/workthreads/MineThread.java +++ b/src/engine/workthreads/MineThread.java @@ -22,18 +22,23 @@ public class MineThread implements Runnable { } @Override public void run() { - //LocalDateTime nextPulse = LocalDateTime.now().withMinute(0).withSecond(0).withNano(0); + LocalDateTime nextPulse = LocalDateTime.now().withMinute(0).withSecond(0).withNano(0); while (true) { + + LocalDateTime now = LocalDateTime.now(); + if(now.isBefore(nextPulse)) + break; + nextPulse = nextPulse.plusMinutes(1); for (Mine mine : Mine.getMines()) { if(mine.wasClaimed) continue; - LocalDateTime now = LocalDateTime.now(); + int minute = 0; if (!mine.firstThirty) minute = 30; - LocalDateTime openTime = LocalDateTime.now().withHour(mine.liveTime).withMinute(minute).withSecond(0); + LocalDateTime openTime = now.withHour(mine.liveTime).withMinute(minute).withSecond(0); LocalDateTime closeTime = openTime.plusMinutes(30); if (now.isAfter(openTime) && !mine.isActive) {