From 09e57852f496129f9329402672735e324c51b029 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 7 Mar 2024 20:25:56 -0600 Subject: [PATCH] 30 minute mine windows --- src/engine/objects/Mine.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/engine/objects/Mine.java b/src/engine/objects/Mine.java index 406c0388..204d0e16 100644 --- a/src/engine/objects/Mine.java +++ b/src/engine/objects/Mine.java @@ -311,8 +311,13 @@ public class Mine extends AbstractGameObject { mineOpenTime = LocalDateTime.now().withHour(mine.liveTime).withMinute(30).withSecond(0).withNano(0); } - writer.putLocalDateTime(mineOpenTime); - writer.putLocalDateTime(mineOpenTime.plusMinutes(30)); + if(LocalDateTime.now().isAfter(mineOpenTime.plusMinutes(30))){ + writer.putLocalDateTime(mineOpenTime.plusDays(1)); + writer.putLocalDateTime(mineOpenTime.plusMinutes(30).plusDays(1)); + } else { + writer.putLocalDateTime(mineOpenTime); + writer.putLocalDateTime(mineOpenTime.plusMinutes(30)); + } writer.put(mine.isActive ? (byte) 0x01 : (byte) 0x00); Building mineTower = BuildingManager.getBuilding(mine.buildingID);