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

Diff of /miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/creative/GeneralContractorCommands.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1728 by torben, Mon Mar 12 20:22:27 2012 UTC revision 1729 by torben, Tue Mar 13 07:58:31 2012 UTC
# Line 9  import org.bukkit.command.CommandExecuto Line 9  import org.bukkit.command.CommandExecuto
9  import org.bukkit.command.CommandSender;  import org.bukkit.command.CommandSender;
10  import org.bukkit.entity.Player;  import org.bukkit.entity.Player;
11    
12    import java.util.HashMap;
13    
14  public class GeneralContractorCommands implements CommandExecutor{  public class GeneralContractorCommands implements CommandExecutor{
15    
16            class StoredCommand {
17                    public StoredCommand(String l, String a[]) {
18                            this.label = l;
19                            this.args = a;
20                    }
21                    public String label;
22                    public String args[];
23            }
24    
25          final static int Y_MAX = 255;          final static int Y_MAX = 255;
26    
27            HashMap<String,StoredCommand> commands = new HashMap<String,StoredCommand>();
28                    
29          //@Override          //@Override
30          public boolean onCommand(final CommandSender sender, Command command, String label, String[] args) {          public boolean onCommand(final CommandSender sender, Command command, String label, String[] args) {
# Line 28  public class GeneralContractorCommands i Line 40  public class GeneralContractorCommands i
40                          player.sendMessage( ChatColor.RED + "This command may only be used in creative world" );                          player.sendMessage( ChatColor.RED + "This command may only be used in creative world" );
41                          return true;                          return true;
42                  }                  }
43    
44                    commands.put(player.getName(), new StoredCommand(label,args) );
45    
46                    if (label.equals("replay") || label.equals("*") ) {
47                            StoredCommand cmd = commands.get(player.getName() );
48                            if (cmd != null) {
49                                    label = cmd.label;
50                                    args = cmd.args;
51                            }
52                    }
53                                    
54                  //System.out.println( ">>" + label); //DEBUG                  //System.out.println( ">>" + label); //DEBUG
55                                    
# Line 160  public class GeneralContractorCommands i Line 182  public class GeneralContractorCommands i
182                  for (int x=(playerX-radius); x<=(playerX+radius); x++) {                  for (int x=(playerX-radius); x<=(playerX+radius); x++) {
183                          for (int z=(playerZ-radius); z<=(playerZ+radius); z++) {                          for (int z=(playerZ-radius); z<=(playerZ+radius); z++) {
184                                  //int y = getGroundLevel(x,z) - 1;                                  //int y = getGroundLevel(x,z) - 1;
185                                  int y = world.getHighestBlockYAt(x, z) - 1;                                  int y = world.getHighestBlockYAt(x, z) ;
186                                                                    
187                                  world.getBlockAt(x, y, z).setTypeId(blockid);                                  world.getBlockAt(x, y, z).setTypeId(blockid);
188                          }                          }

Legend:
Removed from v.1728  
changed lines
  Added in v.1729

  ViewVC Help
Powered by ViewVC 1.1.20