From c356ecd1686b94e1b6366c0312b86c121f8e07d3 Mon Sep 17 00:00:00 2001 From: speed <43330808+speedxx@users.noreply.github.com> Date: Mon, 14 Dec 2020 19:05:13 -0500 Subject: [PATCH] formatting & rename stuff --- .../command/Command_manuallyverify.java | 13 +++++++------ .../command/Command_playerverification.java | 12 +++++++----- .../totalfreedommod/command/Command_verify.java | 13 +++++++------ .../totalfreedommod/discord/Discord.java | 5 ++--- src/main/resources/config.yml | 2 +- 5 files changed, 24 insertions(+), 21 deletions(-) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_manuallyverify.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_manuallyverify.java index 0c88622e..27861817 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_manuallyverify.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_manuallyverify.java @@ -15,17 +15,19 @@ public class Command_manuallyverify extends FreedomCommand @Override public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { - boolean enableBot = (ConfigEntry.DISCORD_VERIFICATION.getBoolean()); + boolean verificationEnabled = ConfigEntry.DISCORD_VERIFICATION.getBoolean(); if (!plugin.dc.enabled) { - msg("The Discord verification system is currently disabled", ChatColor.RED); + msg("The Discord verification system is currently disabled.", ChatColor.RED); return true; } - if (!enableBot) + + if (!verificationEnabled) { - msg("The Discord verification system is currently disabled", ChatColor.RED); + msg("The Discord verification system is currently disabled.", ChatColor.RED); return true; } + if (args.length == 0) { return false; @@ -56,7 +58,6 @@ public class Command_manuallyverify extends FreedomCommand plugin.pl.verify(player, null); plugin.rm.updateDisplay(player); - return true; } -} +} \ No newline at end of file diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_playerverification.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_playerverification.java index ea1a3926..e649fd84 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_playerverification.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_playerverification.java @@ -21,11 +21,11 @@ public class Command_playerverification extends FreedomCommand public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { PlayerData target = plugin.pl.getData(playerSender); - boolean enableBot = (ConfigEntry.DISCORD_VERIFICATION.getBoolean()); + boolean verificationEnabled = ConfigEntry.DISCORD_VERIFICATION.getBoolean(); List ips = new ArrayList<>(); ips.addAll(target.getIps()); - if(enableBot) + if (verificationEnabled) { if (args.length == 1) { @@ -87,6 +87,7 @@ public class Command_playerverification extends FreedomCommand msg("Please link a discord account with /linkdiscord.", ChatColor.RED); return true; } + data.setVerification(true); plugin.pl.save(data); msg("Re-enabled Discord verification.", ChatColor.GREEN); @@ -100,6 +101,7 @@ public class Command_playerverification extends FreedomCommand msg("Discord verification is already disabled for you.", ChatColor.RED); return true; } + data.setVerification(false); plugin.pl.save(data); msg("Disabled Discord verification.", ChatColor.GREEN); @@ -137,7 +139,7 @@ public class Command_playerverification extends FreedomCommand } else { - msg("Failed to generate backup codes, please contact a developer (preferably Seth)", ChatColor.RED); + msg("Failed to generate backup codes, please contact a developer.", ChatColor.RED); } return true; } @@ -147,7 +149,7 @@ public class Command_playerverification extends FreedomCommand } else { - msg("The Discord verification system is currently disabled", ChatColor.RED); + msg("The Discord verification system is currently disabled.", ChatColor.RED); } return true; } @@ -162,4 +164,4 @@ public class Command_playerverification extends FreedomCommand return Collections.emptyList(); } -} +} \ No newline at end of file diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_verify.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_verify.java index c0eb9474..e23a4ad5 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_verify.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_verify.java @@ -18,17 +18,19 @@ public class Command_verify extends FreedomCommand @Override public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { - boolean enableBot = (ConfigEntry.DISCORD_VERIFICATION.getBoolean()); + boolean verificationEnabled = ConfigEntry.DISCORD_VERIFICATION.getBoolean(); if (!plugin.dc.enabled) { - msg("The Discord verification system is currently disabled", ChatColor.RED); + msg("The Discord verification system is currently disabled.", ChatColor.RED); return true; } - if (!enableBot) + + if (!verificationEnabled) { - msg("The Discord verification system is currently disabled", ChatColor.RED); + msg("The Discord verification system is currently disabled.", ChatColor.RED); return true; } + if (senderIsConsole) { msg("/manuallyverify ", ChatColor.WHITE); @@ -42,7 +44,6 @@ public class Command_verify extends FreedomCommand } PlayerData playerData = plugin.pl.getData(playerSender); - String discordId = playerData.getDiscordID(); if (playerData.getDiscordID() == null) @@ -96,4 +97,4 @@ public class Command_verify extends FreedomCommand } return true; } -} +} \ No newline at end of file diff --git a/src/main/java/me/totalfreedom/totalfreedommod/discord/Discord.java b/src/main/java/me/totalfreedom/totalfreedommod/discord/Discord.java index 9aa673bb..ee0c9a54 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/discord/Discord.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/discord/Discord.java @@ -59,12 +59,11 @@ public class Discord extends FreedomService public static JDA bot = null; public Boolean enabled = false; - public Boolean enableBot = false; public void startBot() { - enableBot = (ConfigEntry.DISCORD_VERIFICATION.getBoolean()); - if (!enableBot) + boolean verificationEnabled = ConfigEntry.DISCORD_VERIFICATION.getBoolean(); + if (!verificationEnabled) { FLog.info("Discord Verification has been manually disabled."); return; diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index f80bb375..689f222e 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -53,7 +53,7 @@ server: # Discord discord: - # Do you want to enable the bot? (Disabled by default) + # Do you want to enable the Discord verification system? (Disabled by default) verification: false # If you do not have a token, make a bot account and get one at https://discordapp.com/developers/applications/me token: ''