mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 17:25:37 +00:00
293ea04c56
* rename everything containing staff back to admin (as requested by ryan i've renamed commands like slconfig to saconfig but left "slconfig" as an alias) * format almost every file correctly * a few other improvements
44 lines
1.5 KiB
Java
44 lines
1.5 KiB
Java
package me.totalfreedom.totalfreedommod.command;
|
|
|
|
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
|
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;
|
|
|
|
@CommandPermissions(level = Rank.ADMIN, source = SourceType.BOTH)
|
|
@CommandParameters(description = "Unblocks commands for a player.", usage = "/<command> <player>", aliases = "unblockcommand,unblockcommands,ubcmds,unblockcmds,ubc")
|
|
public class Command_unblockcmd extends FreedomCommand
|
|
{
|
|
|
|
@Override
|
|
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
|
{
|
|
if (args.length == 0)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
Player player = getPlayer(args[0]);
|
|
if (player == null)
|
|
{
|
|
sender.sendMessage(FreedomCommand.PLAYER_NOT_FOUND);
|
|
return true;
|
|
}
|
|
|
|
FPlayer fPlayer = plugin.pl.getPlayer(player);
|
|
if (fPlayer.allCommandsBlocked())
|
|
{
|
|
fPlayer.setCommandsBlocked(false);
|
|
FUtil.adminAction(sender.getName(), "Unblocking all commands for " + player.getName(), true);
|
|
msg("Unblocked commands for " + player.getName() + ".");
|
|
}
|
|
else
|
|
{
|
|
msg("That players commands aren't blocked.", ChatColor.RED);
|
|
}
|
|
return true;
|
|
}
|
|
} |