TotalFreedomMod/src/me/StevenLawson/TotalFreedomMod/Commands/Command_landmine.java

35 lines
1.1 KiB
Java
Raw Normal View History

2011-10-21 19:28:03 +00:00
package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.TFM_LandmineData;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class Command_landmine extends TFM_Command
{
@Override
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{
if (senderIsConsole)
{
sender.sendMessage(TotalFreedomMod.NOT_FROM_CONSOLE);
}
else if (sender.isOp())
{
Block landmine = sender_p.getLocation().getBlock().getRelative(BlockFace.DOWN);
landmine.setType(Material.TNT);
plugin.landmines.add(new TFM_LandmineData(landmine.getLocation(), sender_p));
}
else
{
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS);
}
return true;
}
}