/[projects]/miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/deprecated/BoomCommand.java
ViewVC logotype

Contents of /miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/deprecated/BoomCommand.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1653 - (show annotations) (download)
Fri Dec 9 17:06:52 2011 UTC (12 years, 5 months ago) by torben
File size: 1319 byte(s)
deprecate all of the more experimental / non-survival commands
1 package dk.thoerup.bukkit.hoeruputils;
2
3 import org.bukkit.ChatColor;
4 import org.bukkit.Location;
5 import org.bukkit.Server;
6 import org.bukkit.World;
7 import org.bukkit.command.Command;
8 import org.bukkit.command.CommandExecutor;
9 import org.bukkit.command.CommandSender;
10 import org.bukkit.entity.Player;
11 import org.bukkit.plugin.Plugin;
12
13 public class BoomCommand implements CommandExecutor {
14
15 Plugin plugin;
16
17 public BoomCommand(Plugin plugin) {
18 this.plugin = plugin;
19 }
20
21
22 @Override
23 public boolean onCommand(final CommandSender sender, Command command, String label, String[] args) {
24
25 if (!(sender instanceof Player)) {
26 return false;
27 }
28 Player p = (Player) sender;
29
30 if (!p.isOp() ) {
31 p.sendMessage("Only ops can make it go boom");
32 return true;
33 }
34
35 final Server server = sender.getServer();
36
37 final World w = p.getWorld();
38 final Location l = p.getLocation();
39
40 Runnable r = new Runnable() {
41 @Override
42 public void run() {
43 w.createExplosion(l, 16.0f);
44 server.broadcastMessage( ChatColor.YELLOW + "BOOOM!!!" );
45 }
46 };
47
48 server.getScheduler().scheduleSyncDelayedTask(plugin, r, 15*20);
49
50 server.broadcastMessage( ChatColor.YELLOW + "Run Forrest!! Things are about to go boom" );
51 server.getLogger().info("[Boom] Player " + p.getName() + " used /boom" );
52
53 return true;
54 }
55 }

Properties

Name Value
svn:mergeinfo

  ViewVC Help
Powered by ViewVC 1.1.20