mirror of
https://github.com/Shimeo98/DiscordWhitelisterSpigot.git
synced 2024-12-01 07:03:36 +01:00
clean up
This commit is contained in:
parent
cdc1ba23f3
commit
934707e603
@ -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 {
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user