2011-03-19 22:39:51 +00:00
|
|
|
package com.earth2me.essentials.commands;
|
|
|
|
|
|
|
|
import net.minecraft.server.EntityTNTPrimed;
|
|
|
|
import net.minecraft.server.World;
|
|
|
|
import org.bukkit.Location;
|
|
|
|
import org.bukkit.Server;
|
|
|
|
import org.bukkit.craftbukkit.CraftWorld;
|
|
|
|
import com.earth2me.essentials.Essentials;
|
|
|
|
import com.earth2me.essentials.User;
|
|
|
|
import com.earth2me.essentials.TargetBlock;
|
|
|
|
|
|
|
|
|
|
|
|
public class Commandantioch extends EssentialsCommand
|
|
|
|
{
|
|
|
|
public Commandantioch()
|
|
|
|
{
|
|
|
|
super("antioch");
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void run(Server server, Essentials parent, User user, String commandLabel, String[] args) throws Exception
|
|
|
|
{
|
2011-04-11 11:23:10 +00:00
|
|
|
/*if (!user.isOp())
|
2011-03-19 22:39:51 +00:00
|
|
|
{
|
|
|
|
user.sendMessage("§cNone shall pass.");
|
|
|
|
return;
|
2011-04-11 11:23:10 +00:00
|
|
|
}*/
|
2011-03-19 22:39:51 +00:00
|
|
|
|
|
|
|
server.broadcastMessage("...lobbest thou thy Holy Hand Grenade of Antioch towards thy foe,");
|
|
|
|
server.broadcastMessage("who being naughty in My sight, shall snuff it.");
|
|
|
|
|
|
|
|
Location loc = user.getLocation();
|
|
|
|
World world = ((CraftWorld)user.getWorld()).getHandle();
|
|
|
|
loc = new TargetBlock(user).getTargetBlock().getLocation();
|
|
|
|
EntityTNTPrimed tnt = new EntityTNTPrimed(world, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
|
2011-04-21 09:33:25 +00:00
|
|
|
world.addEntity(tnt);
|
|
|
|
world.makeSound(tnt, "random.fuse", 1.0F, 1.0F);
|
2011-03-19 22:39:51 +00:00
|
|
|
}
|
|
|
|
}
|