formatting & rename stuff

This commit is contained in:
speed 2020-12-14 19:05:13 -05:00
parent f8ce64d6c3
commit c356ecd168
5 changed files with 24 additions and 21 deletions

View File

@ -15,17 +15,19 @@ public class Command_manuallyverify extends FreedomCommand
@Override @Override
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) 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) 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; 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; return true;
} }
if (args.length == 0) if (args.length == 0)
{ {
return false; return false;
@ -56,7 +58,6 @@ public class Command_manuallyverify extends FreedomCommand
plugin.pl.verify(player, null); plugin.pl.verify(player, null);
plugin.rm.updateDisplay(player); plugin.rm.updateDisplay(player);
return true; return true;
} }
} }

View File

@ -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) public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{ {
PlayerData target = plugin.pl.getData(playerSender); PlayerData target = plugin.pl.getData(playerSender);
boolean enableBot = (ConfigEntry.DISCORD_VERIFICATION.getBoolean()); boolean verificationEnabled = ConfigEntry.DISCORD_VERIFICATION.getBoolean();
List<String> ips = new ArrayList<>(); List<String> ips = new ArrayList<>();
ips.addAll(target.getIps()); ips.addAll(target.getIps());
if(enableBot) if (verificationEnabled)
{ {
if (args.length == 1) if (args.length == 1)
{ {
@ -87,6 +87,7 @@ public class Command_playerverification extends FreedomCommand
msg("Please link a discord account with /linkdiscord.", ChatColor.RED); msg("Please link a discord account with /linkdiscord.", ChatColor.RED);
return true; return true;
} }
data.setVerification(true); data.setVerification(true);
plugin.pl.save(data); plugin.pl.save(data);
msg("Re-enabled Discord verification.", ChatColor.GREEN); 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); msg("Discord verification is already disabled for you.", ChatColor.RED);
return true; return true;
} }
data.setVerification(false); data.setVerification(false);
plugin.pl.save(data); plugin.pl.save(data);
msg("Disabled Discord verification.", ChatColor.GREEN); msg("Disabled Discord verification.", ChatColor.GREEN);
@ -137,7 +139,7 @@ public class Command_playerverification extends FreedomCommand
} }
else 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; return true;
} }
@ -147,7 +149,7 @@ public class Command_playerverification extends FreedomCommand
} }
else else
{ {
msg("The Discord verification system is currently disabled", ChatColor.RED); msg("The Discord verification system is currently disabled.", ChatColor.RED);
} }
return true; return true;
} }

View File

@ -18,17 +18,19 @@ public class Command_verify extends FreedomCommand
@Override @Override
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) 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) 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; 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; return true;
} }
if (senderIsConsole) if (senderIsConsole)
{ {
msg("/manuallyverify <playername>", ChatColor.WHITE); msg("/manuallyverify <playername>", ChatColor.WHITE);
@ -42,7 +44,6 @@ public class Command_verify extends FreedomCommand
} }
PlayerData playerData = plugin.pl.getData(playerSender); PlayerData playerData = plugin.pl.getData(playerSender);
String discordId = playerData.getDiscordID(); String discordId = playerData.getDiscordID();
if (playerData.getDiscordID() == null) if (playerData.getDiscordID() == null)

View File

@ -59,12 +59,11 @@ public class Discord extends FreedomService
public static JDA bot = null; public static JDA bot = null;
public Boolean enabled = false; public Boolean enabled = false;
public Boolean enableBot = false;
public void startBot() public void startBot()
{ {
enableBot = (ConfigEntry.DISCORD_VERIFICATION.getBoolean()); boolean verificationEnabled = ConfigEntry.DISCORD_VERIFICATION.getBoolean();
if (!enableBot) if (!verificationEnabled)
{ {
FLog.info("Discord Verification has been manually disabled."); FLog.info("Discord Verification has been manually disabled.");
return; return;

View File

@ -53,7 +53,7 @@ server:
# Discord # Discord
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 verification: false
# If you do not have a token, make a bot account and get one at https://discordapp.com/developers/applications/me # If you do not have a token, make a bot account and get one at https://discordapp.com/developers/applications/me
token: '' token: ''