From c63860cea87a0c53d360a77ec071671a9c8d6892 Mon Sep 17 00:00:00 2001 From: Si6gma <90695450+Si6gma@users.noreply.github.com> Date: Wed, 18 Feb 2026 14:09:36 +0530 Subject: [PATCH] fix: Allow empty values in DurationController to disable event notifications - Modify toString() to return empty string for duration <= 0 - Modify isValid() to accept blank strings as valid input - This allows users to clear text boxes to disable notifications as documented in the tooltip Fixes issue where emptying the notification time fields would fill them with 'Now' instead of disabling notifications --- .../de/hysky/skyblocker/utils/config/DurationController.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/de/hysky/skyblocker/utils/config/DurationController.java b/src/main/java/de/hysky/skyblocker/utils/config/DurationController.java index 60a10e804bc..b39999cc597 100644 --- a/src/main/java/de/hysky/skyblocker/utils/config/DurationController.java +++ b/src/main/java/de/hysky/skyblocker/utils/config/DurationController.java @@ -27,6 +27,7 @@ public DurationController() { } private static String toString(int duration) { + if (duration <= 0) return ""; return SkyblockTime.formatTime(duration).getString(); } @@ -49,6 +50,9 @@ private static int fromString(String value) { } private static boolean isValid(String s) { + // Allow empty string to disable notifications + if (s.isBlank()) return true; + Matcher hoursMatcher = hoursPattern.matcher(s); Matcher minutesMatcher = minutesPattern.matcher(s); Matcher secondsMatcher = secondsPattern.matcher(s);