mirror of
https://github.com/TheDeus-Group/TFM-4.3-Reloaded.git
synced 2024-06-11 02:04:57 +00:00
055973aa37
Refractoring Reworked /saconfig Reworked part of the command system Removed unused config sections Refractored part of the config Fixed bugs with admin list Actually allow CONSOLE to have senior perms
68 lines
1.9 KiB
Java
68 lines
1.9 KiB
Java
package me.totalfreedom.totalfreedommod.command;
|
|
|
|
import me.totalfreedom.totalfreedommod.rank.PlayerRank;
|
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
|
import org.bukkit.ChatColor;
|
|
import org.bukkit.GameMode;
|
|
import org.bukkit.Location;
|
|
import org.bukkit.World;
|
|
import org.bukkit.command.Command;
|
|
import org.bukkit.command.CommandSender;
|
|
import org.bukkit.entity.Player;
|
|
|
|
@CommandPermissions(level = PlayerRank.SUPER_ADMIN, source = SourceType.BOTH)
|
|
@CommandParameters(description = "Someone being a little bitch? Smite them down...", usage = "/<command> [playername]")
|
|
public class Command_smite extends FreedomCommand
|
|
{
|
|
|
|
@Override
|
|
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
|
{
|
|
if (args.length != 1)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
final Player player = getPlayer(args[0]);
|
|
|
|
if (player == null)
|
|
{
|
|
msg(FreedomCommand.PLAYER_NOT_FOUND);
|
|
return true;
|
|
}
|
|
|
|
smite(player);
|
|
|
|
return true;
|
|
}
|
|
|
|
public static void smite(final Player player)
|
|
{
|
|
FUtil.bcastMsg(player.getName() + " has been a naughty, naughty boy.", ChatColor.RED);
|
|
|
|
//Deop
|
|
player.setOp(false);
|
|
|
|
//Set gamemode to survival:
|
|
player.setGameMode(GameMode.SURVIVAL);
|
|
|
|
//Clear inventory:
|
|
player.getInventory().clear();
|
|
|
|
//Strike with lightning effect:
|
|
final Location targetPos = player.getLocation();
|
|
final World world = player.getWorld();
|
|
for (int x = -1; x <= 1; x++)
|
|
{
|
|
for (int z = -1; z <= 1; z++)
|
|
{
|
|
final Location strike_pos = new Location(world, targetPos.getBlockX() + x, targetPos.getBlockY(), targetPos.getBlockZ() + z);
|
|
world.strikeLightning(strike_pos);
|
|
}
|
|
}
|
|
|
|
//Kill:
|
|
player.setHealth(0.0);
|
|
}
|
|
}
|