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
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;
}
}

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)
{
PlayerData target = plugin.pl.getData(playerSender);
boolean enableBot = (ConfigEntry.DISCORD_VERIFICATION.getBoolean());
boolean verificationEnabled = ConfigEntry.DISCORD_VERIFICATION.getBoolean();
List<String> 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;
}

View File

@ -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 <playername>", 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)

View File

@ -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;

View File

@ -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: ''