2020-06-30 07:25:38 +00:00
|
|
|
package me.totalfreedom.totalfreedommod.command;
|
|
|
|
|
|
|
|
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 02:51:15 +00:00
|
|
|
@CommandPermissions(level = Rank.NEW_ADMIN, source = SourceType.BOTH)
|
2020-06-30 07:25:38 +00:00
|
|
|
@CommandParameters(description = "Manually verify someone", usage = "/<command> <playername>", aliases="mv")
|
|
|
|
public class Command_manuallyverify extends FreedomCommand
|
|
|
|
{
|
|
|
|
@Override
|
|
|
|
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!plugin.dc.enabled)
|
|
|
|
{
|
|
|
|
msg("The Discord verification system is currently disabled", ChatColor.RED);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (args.length == 0)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
final Player player = getPlayer(args[0]);
|
|
|
|
if (player == null)
|
|
|
|
{
|
|
|
|
msg(FreedomCommand.PLAYER_NOT_FOUND);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!plugin.pl.isImposter(player))
|
|
|
|
{
|
|
|
|
msg("That player is not an impostor.");
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-08-15 22:42:46 +00:00
|
|
|
FUtil.staffAction(sender.getName(), "Manually verifying player " + player.getName(), false);
|
2020-06-30 07:25:38 +00:00
|
|
|
player.setOp(true);
|
|
|
|
player.sendMessage(YOU_ARE_OP);
|
|
|
|
|
|
|
|
if (plugin.pl.getPlayer(player).getFreezeData().isFrozen())
|
|
|
|
{
|
|
|
|
plugin.pl.getPlayer(player).getFreezeData().setFrozen(false);
|
|
|
|
player.sendMessage(ChatColor.GRAY + "You have been unfrozen.");
|
|
|
|
}
|
|
|
|
|
|
|
|
plugin.pl.verify(player, null);
|
|
|
|
plugin.rm.updateDisplay(player);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|