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

Annotation of /miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/deprecated/GrassCommand.java_

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1465 - (hide annotations) (download)
Wed May 18 18:13:55 2011 UTC (13 years ago) by torben
Original Path: miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/GrassCommand.java
File size: 699 byte(s)
add /grass command
1 torben 1465 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 GrassCommand implements CommandExecutor {
12    
13     @Override
14     public boolean onCommand(final CommandSender sender, Command command, String label, String[] args) {
15     if (! (sender instanceof Player)) { //what are you then ?
16     return false;
17     }
18    
19     Player p = (Player) sender;
20    
21     Location l = p.getLocation();
22     World w = l.getWorld();
23     Block b = w.getBlockAt(l);
24    
25     b.setTypeId(2);
26    
27    
28     return true;
29     }
30    
31     }

  ViewVC Help
Powered by ViewVC 1.1.20