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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1501 - (show annotations) (download)
Sat Jun 4 13:55:44 2011 UTC (12 years, 11 months ago) by torben
File size: 1000 byte(s)
added stonercommand
1 package dk.thoerup.bukkit.hoeruputils;
2
3 import org.bukkit.block.Block;
4 import org.bukkit.Location;
5 import org.bukkit.World;
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 StonerCommand 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
26 for (int x=(l.getBlockX()-2); x<=(l.getBlockX()+2); x++) {
27 for (int y=(l.getBlockY()-2); y<=(l.getBlockY()+2); y++) {
28 for (int z=(l.getBlockZ()-2); z<=(l.getBlockZ()+2); z++) {
29 Block block = world.getBlockAt(x,y,z);
30 if (block.getTypeId() == 3 || block.getTypeId() == 4 || block.getTypeId() == 13) {
31 block.setTypeId(1);
32 }
33 }
34 }
35
36 }
37
38 return true;
39 }
40 }

  ViewVC Help
Powered by ViewVC 1.1.20