From f5871d8a18e0be2a3a4538fc0ab4f51f58cef3b3 Mon Sep 17 00:00:00 2001 From: Kevin <92656833+kevinthegreat1@users.noreply.github.com> Date: Sat, 15 Jun 2024 00:15:41 +0800 Subject: Add event notifications criterion (#763) --- .../skyblocker/config/categories/EventNotificationsCategory.java | 7 +++++++ .../skyblocker/config/configs/EventNotificationsConfig.java | 9 +++++++++ 2 files changed, 16 insertions(+) (limited to 'src/main/java/de/hysky/skyblocker/config') diff --git a/src/main/java/de/hysky/skyblocker/config/categories/EventNotificationsCategory.java b/src/main/java/de/hysky/skyblocker/config/categories/EventNotificationsCategory.java index 6fd01cf8..ae4882f2 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/EventNotificationsCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/EventNotificationsCategory.java @@ -24,6 +24,13 @@ public class EventNotificationsCategory { shouldPlaySound = false; return ConfigCategory.createBuilder() .name(Text.translatable("skyblocker.config.eventNotifications")) + .option(Option.createBuilder() + .binding(defaults.eventNotifications.criterion, + () -> config.eventNotifications.criterion, + criterion -> config.eventNotifications.criterion = criterion) + .controller(ConfigUtils::createEnumCyclingListController) + .name(Text.translatable("skyblocker.config.eventNotifications.criterion")) + .build()) .option(Option.createBuilder() .binding(defaults.eventNotifications.reminderSound, () -> config.eventNotifications.reminderSound, diff --git a/src/main/java/de/hysky/skyblocker/config/configs/EventNotificationsConfig.java b/src/main/java/de/hysky/skyblocker/config/configs/EventNotificationsConfig.java index c43ae7a6..1fa7016c 100644 --- a/src/main/java/de/hysky/skyblocker/config/configs/EventNotificationsConfig.java +++ b/src/main/java/de/hysky/skyblocker/config/configs/EventNotificationsConfig.java @@ -9,6 +9,8 @@ import java.util.HashMap; import java.util.Map; public class EventNotificationsConfig { + @SerialEntry + public Criterion criterion = Criterion.SKYBLOCK; @SerialEntry public Sound reminderSound = Sound.PLING; @@ -16,6 +18,13 @@ public class EventNotificationsConfig { @SerialEntry public Map eventsReminderTimes = new HashMap<>(); + public enum Criterion { + NONE, + SKYBLOCK, + HYPIXEL, + EVERYWHERE + } + public enum Sound { NONE(null), BELL(SoundEvents.BLOCK_BELL_USE), -- cgit