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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1521 - (show annotations) (download)
Mon Jun 20 20:10:41 2011 UTC (12 years, 11 months ago) by torben
File size: 1000 byte(s)
added superminer command
1 package dk.thoerup.bukkit.hoeruputils;
2
3 import org.bukkit.Location;
4 import org.bukkit.World;
5 import org.bukkit.block.Block;
6 import org.bukkit.command.Command;
7 import org.bukkit.command.CommandExecutor;
8 import org.bukkit.command.CommandSender;
9 import org.bukkit.entity.Player;
10
11 public class SuperminerCommand implements CommandExecutor {
12
13
14 @Override
15 public boolean onCommand(final CommandSender sender, Command command, String label, String[] args) {
16
17 if (!(sender instanceof Player)) {
18 return false;
19 }
20 Player p = (Player) sender;
21
22 World world = p.getWorld();
23 Location l = p.getLocation();
24
25 for (int x=-5; x<=5; x++) {
26 for (int y=0; y<=5; y++) {
27 for (int z=-5; z<=5; z++) {
28
29 Block b = world.getBlockAt( l.getBlockX()+x, l.getBlockY()+y, l.getBlockZ()+z);
30
31 int id = b.getTypeId();
32
33 if (id == 1 || id == 2 || id == 3 || id == 4 || id == 8 || id == 9 || id == 10 || id == 11 || id == 13) {
34 b.setTypeId( 0 );
35 }
36 }
37
38
39 }
40 }
41
42 return true;
43 }
44 }

  ViewVC Help
Powered by ViewVC 1.1.20