From 6fef1d0092843857fc6f3d612db3af5e816e9951 Mon Sep 17 00:00:00 2001 From: Liam Date: Sat, 6 Jul 2024 06:26:33 +0100 Subject: [PATCH] check feature states --- .../cc/fascinated/bat/features/birthday/BirthdayFeature.java | 2 +- .../fascinated/bat/features/minecraft/MinecraftFeature.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/cc/fascinated/bat/features/birthday/BirthdayFeature.java b/src/main/java/cc/fascinated/bat/features/birthday/BirthdayFeature.java index fa58a27..c1cda9d 100644 --- a/src/main/java/cc/fascinated/bat/features/birthday/BirthdayFeature.java +++ b/src/main/java/cc/fascinated/bat/features/birthday/BirthdayFeature.java @@ -36,7 +36,7 @@ public class BirthdayFeature extends Feature implements EventListener { private void checkBirthdays() { for (Guild guild : DiscordService.JDA.getGuilds()) { BatGuild batGuild = guildService.getGuild(guild.getId()); - if (batGuild == null) { + if (batGuild.getFeatureProfile().isFeatureDisabled(this)) { // Check if the feature is disabled continue; } BirthdayProfile profile = batGuild.getBirthdayProfile(); diff --git a/src/main/java/cc/fascinated/bat/features/minecraft/MinecraftFeature.java b/src/main/java/cc/fascinated/bat/features/minecraft/MinecraftFeature.java index d96c505..9960672 100644 --- a/src/main/java/cc/fascinated/bat/features/minecraft/MinecraftFeature.java +++ b/src/main/java/cc/fascinated/bat/features/minecraft/MinecraftFeature.java @@ -38,6 +38,10 @@ public class MinecraftFeature extends Feature { public void checkServers() { for (Guild guild : DiscordService.JDA.getGuilds()) { BatGuild batGuild = guildService.getGuild(guild.getId()); + if (batGuild.getFeatureProfile().isFeatureDisabled(this)) { // Check if the feature is disabled + continue; + } + batGuild.getMinecraftProfile().checkServers(); } }