From 52d3d8ee3a8824bc1eb432821c15752d9ed738f4 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 7 Jan 2023 13:26:47 -0500 Subject: [PATCH] Not adding an extraneous day each reboot. --- src/engine/objects/Mine.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/engine/objects/Mine.java b/src/engine/objects/Mine.java index e53c6d86..e2b435f1 100644 --- a/src/engine/objects/Mine.java +++ b/src/engine/objects/Mine.java @@ -166,17 +166,11 @@ public class Mine extends AbstractGameObject { if (LocalDateTime.now().isAfter(this.openDate.plusHours(1))) this.openDate = this.openDate.plusDays(1); return; - }else{ + }else this.openDate = mineTimeStamp.toLocalDateTime().withHour(mineTime); - - if (LocalDateTime.now().isAfter(this.openDate.plusHours(1))){ - this.openDate = this.openDate.plusDays(1); - return; - } - } - + //after 1 day... - if(this.openDate.getDayOfYear() - LocalDateTime.now().getDayOfYear() > 1){ + if (this.openDate.getDayOfYear() - LocalDateTime.now().getDayOfYear() > 1){ this.openDate = this.openDate.withDayOfYear(LocalDateTime.now().getDayOfYear()); if (LocalDateTime.now().isAfter(this.openDate.plusHours(1))) this.openDate = this.openDate.plusDays(1);