mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-16 20:36:12 +00:00
35 lines
1.1 KiB
Java
35 lines
1.1 KiB
Java
|
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;
|
||
|
}
|
||
|
}
|