From 626a6828564e5a04ef895f9afe9704f7c54ca965 Mon Sep 17 00:00:00 2001 From: L3cache <85846799+level3cache@users.noreply.github.com> Date: Sat, 28 Sep 2024 20:45:46 +0200 Subject: [PATCH 1/5] fix: update spider's den rain time Updated nextRain time used for calculations to now show correct rain times. Time used: Unix (in milliseconds): 1727548440000 Human Time: GMT Saturday, September 28, 2024 6:34:00 PM Skyblock Time: Year 375, Late Autumn, Day 19 Signed-off-by: L3cache <85846799+level3cache@users.noreply.github.com> --- .../skytils/skytilsmod/features/impl/spidersden/RainTimer.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/spidersden/RainTimer.kt b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/spidersden/RainTimer.kt index 181f454a2..0a0b0f64b 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/spidersden/RainTimer.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/spidersden/RainTimer.kt @@ -28,7 +28,7 @@ import gg.skytils.skytilsmod.utils.graphics.colors.CommonColors * @link https://github.com/PikaFan123/rain-timer */ object RainTimer { - var nextRain = 1596552707000 + var nextRain = 1727548440000 init { RainTimerGuiElement() @@ -86,4 +86,4 @@ object RainTimer { } } -} \ No newline at end of file +} From a65daa79814446cf338094f138404d91dcef0f68 Mon Sep 17 00:00:00 2001 From: L3cache <85846799+level3cache@users.noreply.github.com> Date: Sun, 29 Sep 2024 00:14:33 +0200 Subject: [PATCH 2/5] fix: spider's den rain time Actually fix spider's den rain time feature not showing correct time. Added new variables to make future changes easier with additional helpful comments to further clarify, what each value has to be set to. Signed-off-by: L3cache <85846799+level3cache@users.noreply.github.com> --- .../skytilsmod/features/impl/spidersden/RainTimer.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/spidersden/RainTimer.kt b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/spidersden/RainTimer.kt index 0a0b0f64b..6a8227ce1 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/spidersden/RainTimer.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/spidersden/RainTimer.kt @@ -28,18 +28,20 @@ import gg.skytils.skytilsmod.utils.graphics.colors.CommonColors * @link https://github.com/PikaFan123/rain-timer */ object RainTimer { - var nextRain = 1727548440000 + var nextRain = 1727548440000 // Unix-Time of a past rain event start in milliseconds + var eventCycleTime = 3600000 // Time between two rain event starts in milliseconds + var eventCooldownTime = 2400000 // Time between rain event end and start in milliseconds init { RainTimerGuiElement() - while (nextRain < System.currentTimeMillis()) nextRain += 4850000 + while (nextRain < System.currentTimeMillis()) nextRain += eventCycleTime } class RainTimerGuiElement : GuiElement(name = "Rain Timer", x = 10, y = 10) { override fun render() { if (Utils.inSkyblock && toggled) { - if (nextRain < System.currentTimeMillis()) nextRain += 4850000 - val remainingRain = ((nextRain - System.currentTimeMillis()) - 3850000) / 1000L + if (nextRain < System.currentTimeMillis()) nextRain += eventCycleTime + val remainingRain = ((nextRain - System.currentTimeMillis()) - eventCooldownTime) / 1000L if (remainingRain > 0) { fr.drawString( "${remainingRain / 60}:${"%02d".format(remainingRain % 60)}", From 5a3d9eb2eb4c8a715be85d4f3f5f794befb0b3a3 Mon Sep 17 00:00:00 2001 From: L3cache <85846799+level3cache@users.noreply.github.com> Date: Sun, 29 Sep 2024 00:24:13 +0200 Subject: [PATCH 3/5] Update RainTimer.kt forgot to update nextRain value, because it was one minute behind Signed-off-by: L3cache <85846799+level3cache@users.noreply.github.com> --- .../gg/skytils/skytilsmod/features/impl/spidersden/RainTimer.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/spidersden/RainTimer.kt b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/spidersden/RainTimer.kt index 6a8227ce1..58b5bceff 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/spidersden/RainTimer.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/spidersden/RainTimer.kt @@ -28,7 +28,7 @@ import gg.skytils.skytilsmod.utils.graphics.colors.CommonColors * @link https://github.com/PikaFan123/rain-timer */ object RainTimer { - var nextRain = 1727548440000 // Unix-Time of a past rain event start in milliseconds + var nextRain = 1727548500000 // Unix-Time of a past rain event start in milliseconds var eventCycleTime = 3600000 // Time between two rain event starts in milliseconds var eventCooldownTime = 2400000 // Time between rain event end and start in milliseconds From 5cec6a9c9cb4f780db95f6949ad8deea7687a1d8 Mon Sep 17 00:00:00 2001 From: L3cache <85846799+level3cache@users.noreply.github.com> Date: Sun, 29 Sep 2024 16:31:07 +0200 Subject: [PATCH 4/5] Update RainTimer.kt Changed `var` to `const val` for compiler optimizations Signed-off-by: L3cache <85846799+level3cache@users.noreply.github.com> --- .../skytilsmod/features/impl/spidersden/RainTimer.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/spidersden/RainTimer.kt b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/spidersden/RainTimer.kt index 58b5bceff..73f4a18a2 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/spidersden/RainTimer.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/spidersden/RainTimer.kt @@ -28,9 +28,9 @@ import gg.skytils.skytilsmod.utils.graphics.colors.CommonColors * @link https://github.com/PikaFan123/rain-timer */ object RainTimer { - var nextRain = 1727548500000 // Unix-Time of a past rain event start in milliseconds - var eventCycleTime = 3600000 // Time between two rain event starts in milliseconds - var eventCooldownTime = 2400000 // Time between rain event end and start in milliseconds + const val nextRain = 1727548500000 // Unix-Time of a past rain event start in milliseconds + const val eventCycleTime = 3600000 // Time between two rain event starts in milliseconds + const val eventCooldownTime = 2400000 // Time between rain event end and start in milliseconds init { RainTimerGuiElement() From df9150b14e1e5df3883926148746ac4fa13ba363 Mon Sep 17 00:00:00 2001 From: L3cache <85846799+level3cache@users.noreply.github.com> Date: Sun, 29 Sep 2024 17:02:56 +0200 Subject: [PATCH 5/5] Update RainTimer.kt reverted one `const val` to `var` because it's value changes on line 37 Signed-off-by: L3cache <85846799+level3cache@users.noreply.github.com> --- .../gg/skytils/skytilsmod/features/impl/spidersden/RainTimer.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/spidersden/RainTimer.kt b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/spidersden/RainTimer.kt index 73f4a18a2..0ef4ac9bb 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/spidersden/RainTimer.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/spidersden/RainTimer.kt @@ -28,7 +28,7 @@ import gg.skytils.skytilsmod.utils.graphics.colors.CommonColors * @link https://github.com/PikaFan123/rain-timer */ object RainTimer { - const val nextRain = 1727548500000 // Unix-Time of a past rain event start in milliseconds + var nextRain = 1727548500000 // Unix-Time of a past rain event start in milliseconds const val eventCycleTime = 3600000 // Time between two rain event starts in milliseconds const val eventCooldownTime = 2400000 // Time between rain event end and start in milliseconds