diff --git a/src/main/java/uk/co/angrybee/joe/Commands/CommandAbout.java b/src/main/java/uk/co/angrybee/joe/Commands/CommandAbout.java index 2db7cce..6ae9dfb 100644 --- a/src/main/java/uk/co/angrybee/joe/Commands/CommandAbout.java +++ b/src/main/java/uk/co/angrybee/joe/Commands/CommandAbout.java @@ -5,8 +5,6 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; -import uk.co.angrybee.joe.DiscordClient; -import uk.co.angrybee.joe.VersionInfo; public class CommandAbout implements CommandExecutor { diff --git a/src/main/java/uk/co/angrybee/joe/Commands/CommandReload.java b/src/main/java/uk/co/angrybee/joe/Commands/CommandReload.java index b8224c9..cab2f57 100644 --- a/src/main/java/uk/co/angrybee/joe/Commands/CommandReload.java +++ b/src/main/java/uk/co/angrybee/joe/Commands/CommandReload.java @@ -20,14 +20,14 @@ public class CommandReload implements CommandExecutor Logger pluginLogger = DiscordWhitelister.getPlugin().getLogger(); sender.sendMessage("[DW] Attempting to reload..."); - pluginLogger.info("[DW] " + sender.getName() + " has requested a hot reload"); + pluginLogger.info(sender.getName() + " has requested a hot reload"); - pluginLogger.info("[DW] Shutting down client..."); + pluginLogger.info("Shutting down client..."); boolean shutDownTriggerSuccessful = DiscordClient.ShutdownClient(); if(!shutDownTriggerSuccessful) { - pluginLogger.info("[DW] Failed to trigger shutdown on client"); + pluginLogger.info("Failed to trigger shutdown on client"); sender.sendMessage("[DW] Failed to reload Discord client (Reason: Failed to trigger shutdown on client)"); return false; } @@ -37,13 +37,21 @@ public class CommandReload implements CommandExecutor if(initSuccess == 1) { - pluginLogger.info("[DW] Failed to re-initialize client"); + pluginLogger.info("Failed to re-initialize client"); sender.sendMessage("[DW] Failed to reload Discord client (Reason: Failed to re-initialize client)"); return false; } - pluginLogger.info("[DW] Successfully restarted Discord client"); - sender.sendMessage("[DW] Successfully restarted Discord client"); + if(!DiscordWhitelister.botEnabled) + { + pluginLogger.info("Successfully reloaded configuration file. Bot is disabled as per the config, will not re-initialize"); + sender.sendMessage("[DW] Successfully reloaded configuration file. Bot is disabled as per the config, will not re-initialize"); + } + else + { + pluginLogger.info("Successfully restarted Discord client"); + sender.sendMessage("[DW] Successfully restarted Discord client"); + } return true; } } diff --git a/src/main/java/uk/co/angrybee/joe/DiscordWhitelister.java b/src/main/java/uk/co/angrybee/joe/DiscordWhitelister.java index 02e99dd..abbef25 100755 --- a/src/main/java/uk/co/angrybee/joe/DiscordWhitelister.java +++ b/src/main/java/uk/co/angrybee/joe/DiscordWhitelister.java @@ -1,17 +1,11 @@ package uk.co.angrybee.joe; -import com.sun.org.apache.xml.internal.security.Init; import org.bukkit.Server; import org.bukkit.configuration.InvalidConfigurationException; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.event.Listener; -import org.bukkit.event.EventHandler; -import org.bukkit.event.player.PlayerJoinEvent; -import org.bukkit.event.player.PlayerQuitEvent; -import org.jetbrains.annotations.NotNull; import uk.co.angrybee.joe.Commands.CommandAbout; import uk.co.angrybee.joe.Commands.CommandReload; import uk.co.angrybee.joe.Commands.CommandStatus; @@ -48,7 +42,7 @@ public class DiscordWhitelister extends JavaPlugin public static boolean useCustomMessages = false; public static boolean useIdForRoles = false; - private static boolean botEnabled; + public static boolean botEnabled; private static JavaPlugin thisPlugin; private static Server thisServer;