mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-09-06 06:38:14 +00:00
* 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
37 lines
1.0 KiB
Java
37 lines
1.0 KiB
Java
package me.totalfreedom.totalfreedommod.command;
|
|
|
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
|
import org.bukkit.command.Command;
|
|
import org.bukkit.command.CommandSender;
|
|
import org.bukkit.entity.Player;
|
|
|
|
@CommandPermissions(level = Rank.OP, source = SourceType.BOTH)
|
|
@CommandParameters(description = "Forcefully kill someone - for those who REALLY need to die.", usage = "/<command> <playername>")
|
|
public class Command_forcekill extends FreedomCommand
|
|
{
|
|
|
|
@Override
|
|
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
|
{
|
|
if (!plugin.al.isAdmin(sender) && !senderIsConsole)
|
|
{
|
|
playerSender.setHealth(0);
|
|
return true;
|
|
}
|
|
|
|
if (args.length < 1)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
final Player player = getPlayer(args[0]);
|
|
if (player == null)
|
|
{
|
|
msg(PLAYER_NOT_FOUND);
|
|
return true;
|
|
}
|
|
|
|
player.setHealth(0);
|
|
return true;
|
|
}
|
|
} |