/[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 1750 by torben, Wed Mar 14 20:25:27 2012 UTC revision 1751 by torben, Sun Mar 18 14:58:22 2012 UTC
# Line 68  public class GeneralContractorCommands i Line 68  public class GeneralContractorCommands i
68                          return true;                          return true;
69                  }                  }
70                                    
71                    if ( label.equals("createcave") ) {
72                            if (validateLevelOrFill(player, label, args) ) {
73                                    createCave(player, loc, args);
74                            }
75                            return true;
76                    }
77                                    
78                  if ( label.equals("fillarea") ) {                  if ( label.equals("fillarea") ) {
79                          if (validateLevelOrFill(player, label, args) ) {                          if (validateLevelOrFill(player, label, args) ) {
# Line 324  public class GeneralContractorCommands i Line 330  public class GeneralContractorCommands i
330                  }                  }
331          }          }
332    
333            private void createCave(Player player, Location loc, String[] split) {
334    
335                    int radius = Integer.parseInt(split[0]);
336    
337                    System.out.println("Player " + player.getName() + " used levelarea with radius=" + radius);
338                    
339    
340                    int playerX = loc.getBlockX();
341                    int playerY = loc.getBlockY();
342                    int playerZ = loc.getBlockZ();
343                    
344    
345                    World world = loc.getWorld();
346    
347                    int count = 0;
348                    for (int x=(playerX-radius); x<=(playerX+radius); x++) {
349                            for (int z=(playerZ-radius); z<=(playerZ+radius); z++) {
350    
351                                    int y_max = playerY+radius;
352                                    //for (int y=playerY; y<=playerY+radius; y++) {
353                                    for (int y=playerY; y<=y_max; y++) {
354                                            count++;
355                                            world.getBlockAt(x, y, z).setType(Material.AIR);
356                                            
357                                    }
358    
359                            }
360    
361                    }
362            }
363            
364          private void levelArea(Player player, Location loc, String[] split) {          private void levelArea(Player player, Location loc, String[] split) {
365    
366                  int radius = Integer.parseInt(split[0]);                  int radius = Integer.parseInt(split[0]);
# Line 353  public class GeneralContractorCommands i Line 390  public class GeneralContractorCommands i
390    
391                  }                  }
392          }          }
393            
394    
395    
396          private void resetMap(boolean[][] map) {          private void resetMap(boolean[][] map) {

Legend:
Removed from v.1750  
changed lines
  Added in v.1751

  ViewVC Help
Powered by ViewVC 1.1.20