/[projects]/miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/deprecated/GrassCommand.java |
Parent Directory | Revision Log | Patch
miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/GrassCommand.java revision 1465 by torben, Wed May 18 18:13:55 2011 UTC | miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/deprecated/GrassCommand.java revision 1653 by torben, Fri Dec 9 17:06:52 2011 UTC | |
---|---|---|
# | Line 18 public class GrassCommand implements Com | Line 18 public class GrassCommand implements Com |
18 | ||
19 | Player p = (Player) sender; | Player p = (Player) sender; |
20 | ||
21 | Location l = p.getLocation(); | Location loc = p.getLocation(); |
22 | World w = l.getWorld(); | World w = loc.getWorld(); |
23 | Block b = w.getBlockAt(l); | Block b = w.getBlockAt(loc.getBlockX(), loc.getBlockY()-1, loc.getBlockZ()); |
24 | ||
25 | b.setTypeId(2); | if (b.getTypeId() == 3) { |
26 | b.setTypeId(2); | |
27 | } else { | |
28 | p.sendMessage("Can only plant grass on dirt"); | |
29 | } | |
30 | ||
31 | ||
32 | return true; | return true; |
|
ViewVC Help | |
Powered by ViewVC 1.1.20 |