From 85cd4e0c146573b04ca16eb575b2acaa52ba9d39 Mon Sep 17 00:00:00 2001 From: SlaveOfMagicbot Date: Mon, 12 Oct 2026 12:44:27 -0500 Subject: [PATCH] fix: use LocalDateTime for mine late-window calc in ArcMineWindowAvailableTimeMsg Instant has no hour-of-day field, so .with(HOUR_OF_DAY, ...) threw UnsupportedTemporalTypeException. Switch lateTime to LocalDateTime so the late-window (midnight) time can be set and the seconds-remaining computed. --- .../client/msg/ArcMineWindowAvailableTimeMsg.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/engine/net/client/msg/ArcMineWindowAvailableTimeMsg.java b/src/engine/net/client/msg/ArcMineWindowAvailableTimeMsg.java index 1b4b9fc2..84297bcd 100644 --- a/src/engine/net/client/msg/ArcMineWindowAvailableTimeMsg.java +++ b/src/engine/net/client/msg/ArcMineWindowAvailableTimeMsg.java @@ -17,9 +17,8 @@ import engine.net.Protocol; import engine.objects.Building; import engine.objects.Guild; import engine.server.MBServerStatics; -import java.time.Instant; +import java.time.LocalDateTime; import java.time.Duration; -import java.time.temporal.ChronoField; public class ArcMineWindowAvailableTimeMsg extends ClientNetMsg { @@ -28,7 +27,7 @@ public class ArcMineWindowAvailableTimeMsg extends ClientNetMsg { private int currentMineHour; private Duration secondsLeft; - private Instant lateTime; + private LocalDateTime lateTime; private int late; /** @@ -73,15 +72,15 @@ public class ArcMineWindowAvailableTimeMsg extends ClientNetMsg { currentMineHour = guild.getMineTime(); late = MBServerStatics.MINE_LATE_WINDOW; - lateTime = Instant.now(); + lateTime = LocalDateTime.now(); if (late == 0) - lateTime = lateTime.plus(Duration.ofDays(1)); + lateTime = lateTime.plusDays(1); - lateTime = lateTime.with(ChronoField.HOUR_OF_DAY, late); + lateTime = lateTime.withHour(late); late = ((late > 23) ? (late - 24) : late); - secondsLeft = Duration.between(Instant.now(), lateTime); + secondsLeft = Duration.between(LocalDateTime.now(), lateTime); } /**