2020-06-30 07:25:38 +00:00
|
|
|
package me.totalfreedom.totalfreedommod.command;
|
|
|
|
|
2020-12-25 19:46:43 +00:00
|
|
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
2020-06-30 07:25:38 +00:00
|
|
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
|
|
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
|
|
|
import org.bukkit.ChatColor;
|
|
|
|
import org.bukkit.command.Command;
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
2020-09-28 03:17:01 +00:00
|
|
|
@CommandPermissions(level = Rank.ADMIN, source = SourceType.BOTH)
|
2020-12-09 15:59:12 +00:00
|
|
|
@CommandParameters(description = "Manually verify someone", usage = "/<command> <playername>", aliases = "mv")
|
2020-06-30 07:25:38 +00:00
|
|
|
public class Command_manuallyverify extends FreedomCommand
|
|
|
|
{
|
|
|
|
@Override
|
|
|
|
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
|
|
|
{
|
2020-12-15 00:05:13 +00:00
|
|
|
boolean verificationEnabled = ConfigEntry.DISCORD_VERIFICATION.getBoolean();
|
2020-06-30 07:25:38 +00:00
|
|
|
if (!plugin.dc.enabled)
|
|
|
|
{
|
2020-12-15 00:05:13 +00:00
|
|
|
msg("The Discord verification system is currently disabled.", ChatColor.RED);
|
2020-06-30 07:25:38 +00:00
|
|
|
return true;
|
|
|
|
}
|
2020-12-15 00:05:13 +00:00
|
|
|
|
|
|
|
if (!verificationEnabled)
|
2020-12-08 19:16:28 +00:00
|
|
|
{
|
2020-12-15 00:05:13 +00:00
|
|
|
msg("The Discord verification system is currently disabled.", ChatColor.RED);
|
2020-12-08 19:16:28 +00:00
|
|
|
return true;
|
|
|
|
}
|
2020-12-15 00:05:13 +00:00
|
|
|
|
2020-06-30 07:25:38 +00:00
|
|
|
if (args.length == 0)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
final Player player = getPlayer(args[0]);
|
|
|
|
if (player == null)
|
|
|
|
{
|
|
|
|
msg(FreedomCommand.PLAYER_NOT_FOUND);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-11-09 02:05:54 +00:00
|
|
|
if (!plugin.pl.IsImpostor(player))
|
2020-06-30 07:25:38 +00:00
|
|
|
{
|
|
|
|
msg("That player is not an impostor.");
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-12-09 15:59:12 +00:00
|
|
|
FUtil.adminAction(sender.getName(), "Manually verifying player " + player.getName(), false);
|
2020-06-30 07:25:38 +00:00
|
|
|
player.setOp(true);
|
2021-04-05 23:13:26 +00:00
|
|
|
msg(player, YOU_ARE_OP);
|
2020-06-30 07:25:38 +00:00
|
|
|
|
|
|
|
if (plugin.pl.getPlayer(player).getFreezeData().isFrozen())
|
|
|
|
{
|
|
|
|
plugin.pl.getPlayer(player).getFreezeData().setFrozen(false);
|
2021-04-05 23:13:26 +00:00
|
|
|
msg(player, "You have been unfrozen.");
|
2020-06-30 07:25:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
plugin.pl.verify(player, null);
|
|
|
|
plugin.rm.updateDisplay(player);
|
|
|
|
return true;
|
|
|
|
}
|
2020-12-15 00:05:13 +00:00
|
|
|
}
|