/[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 3139 by torben, Fri Nov 18 20:50:34 2016 UTC revision 3204 by torben, Thu Jun 1 13:18:05 2017 UTC
# Line 30  public class GeneralContractorCommands i Line 30  public class GeneralContractorCommands i
30                          Material.STONE,                          Material.STONE,
31                          Material.GRASS,                          Material.GRASS,
32                          Material.DIRT,                          Material.DIRT,
33                          Material.COBBLESTONE                          Material.COBBLESTONE,
34                            Material.WOOD,
35                            Material.BEDROCK,
36                            Material.WATER,
37                            Material.SAND,
38                            Material.GRAVEL,
39                            Material.GOLD_ORE,
40                            Material.IRON_ORE,
41                            Material.COAL_ORE,
42                            Material.LOG,
43                            Material.LEAVES,
44                            Material.GLASS,
45                            Material.LAPIS_ORE,
46                            Material.LAPIS_BLOCK,
47                            Material.SANDSTONE,
48                            Material.WOOL,
49                            Material.GOLD_BLOCK,
50                            Material.IRON_BLOCK,
51                            Material.BRICK,
52                            Material.MOSSY_COBBLESTONE,
53                            Material.OBSIDIAN,
54                            Material.DIAMOND_ORE,
55                            Material.DIAMOND_BLOCK,
56                            Material.ICE,
57                            Material.SNOW,
58                            Material.CLAY,
59                            Material.NETHERRACK,
60                            Material.SOUL_SAND
61          };          };
62  //4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 35, 41, 42, 43, 44, 45, 48, 49, 56, 57, 73, 74, 79, 80, 82} ;  //4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 35, 41, 42, 43, 44, 45, 48, 49, 56, 57, 73, 74, 79, 80, 82} ;
63    
# Line 95  public class GeneralContractorCommands i Line 122  public class GeneralContractorCommands i
122                          }                                }      
123                          return true;                          return true;
124                  }                  }
125    
126                    if (label.equals("levelandfillarea") ) {
127                            if (validateLevelOrFill(player, label, args) ) {
128    
129                                    levelArea(player, loc, args);
130                                    fillArea(player, loc, args);                            
131                                    setSurface(player, loc, args);  
132    
133                            }
134                    }              
135                                    
136                  if ( label.equals("slopearea") ) {                  if ( label.equals("slopearea") ) {
137                          slopeArea(player, loc, args);                            slopeArea(player, loc, args);  
# Line 118  public class GeneralContractorCommands i Line 155  public class GeneralContractorCommands i
155                          }                          }
156                          return true;                          return true;
157                  }                  }
158    
159    
160                    
161                    
162                  return false;                  return false;
# Line 176  public class GeneralContractorCommands i Line 215  public class GeneralContractorCommands i
215                          return;                          return;
216                  }                  }
217    
218                  if (radius > 20) {                  if (radius > 25) {
219                          player.sendMessage("platform: radius may not exceed 20");                          player.sendMessage("platform: radius may not exceed 25");
220                          return;                          return;
221                  }                  }
222    
223                  Material material = Material.matchMaterial( split[1] );                  Material material = Material.matchMaterial( split[1] );
224                  if (material == null) {                  if (material == null) {
225                          player.sendMessage("platform: blockid must be an integer");                          player.sendMessage("platform: unknown material: " + split[1] );
226                          return;                          return;
227                  }                  }
228  /*  /*
# Line 231  public class GeneralContractorCommands i Line 270  public class GeneralContractorCommands i
270                          return;                          return;
271                  }                  }
272    
273                  if (radius > 20) {                  if (radius > 25) {
274                          player.sendMessage("setsurface: radius may not exceed 20");                          player.sendMessage("setsurface: radius may not exceed 25");
275                          return;                          return;
276                  }                  }
277    
278                  Material material = Material.matchMaterial( split[1] );                  Material material = Material.matchMaterial( split[1] );
279                  if (material == null) {                  if (material == null) {
280                          player.sendMessage("platform: blockid must be an integer");                          player.sendMessage("setsurface: unknown material: " + split[1] );
281                          return;                          return;
282                  }                  }
283    
# Line 284  public class GeneralContractorCommands i Line 323  public class GeneralContractorCommands i
323                          return false;                          return false;
324                  }                  }
325    
326                  if (radius > 20) {                  if (radius > 25) {
327                          player.sendMessage(label + ": radius may not exceed 20");                          player.sendMessage(label + ": radius may not exceed 25");
328                          return false;                          return false;
329                  }                  }
330                                    
331                  if (split.length == 2) {                  if (split.length == 2) {
332                          Material material = Material.matchMaterial( split[1] );                          Material material = Material.matchMaterial( split[1] );
333                          if (material == null) {                          if (material == null) {
334                                  player.sendMessage(label + ": id must be an integer");                                  player.sendMessage(label + ": unknown material: " + split[1] );
335                                  return false;                                  return false;
336                          }                          }
337                          if ( material == Material.TNT) {                          if ( material == Material.TNT) {
# Line 356  public class GeneralContractorCommands i Line 395  public class GeneralContractorCommands i
395    
396                  World world = loc.getWorld();                  World world = loc.getWorld();
397    
398                  int count = 0;                  
399                  for (int x=(playerX-radius); x<=(playerX+radius); x++) {                  for (int x=(playerX-radius); x<=(playerX+radius); x++) {
400                          for (int z=(playerZ-radius); z<=(playerZ+radius); z++) {                          for (int z=(playerZ-radius); z<=(playerZ+radius); z++) {
401    
402                                  int y_max = playerY+radius;                                  int y_max = playerY+radius;
403                                  //for (int y=playerY; y<=playerY+radius; y++) {                                  //for (int y=playerY; y<=playerY+radius; y++) {
404                                  for (int y=playerY; y<=y_max; y++) {                                  for (int y=playerY; y<=y_max; y++) {
405                                          count++;  
406                                          world.getBlockAt(x, y, z).setType(Material.AIR);                                          world.getBlockAt(x, y, z).setType(Material.AIR);
407                                                                                    
408                                  }                                  }
# Line 387  public class GeneralContractorCommands i Line 426  public class GeneralContractorCommands i
426    
427                  World world = loc.getWorld();                  World world = loc.getWorld();
428    
                 int count = 0;  
429                  for (int x=(playerX-radius); x<=(playerX+radius); x++) {                  for (int x=(playerX-radius); x<=(playerX+radius); x++) {
430                          for (int z=(playerZ-radius); z<=(playerZ+radius); z++) {                          for (int z=(playerZ-radius); z<=(playerZ+radius); z++) {
431    
432                                  //for (int y=playerY; y<=playerY+radius; y++) {                                  //for (int y=playerY; y<=playerY+radius; y++) {
433                                  for (int y=playerY; y<=Y_MAX; y++) {                                  for (int y=playerY; y<=Y_MAX; y++) {
                                         count++;  
434                                          world.getBlockAt(x, y, z).setType(Material.AIR);                                          world.getBlockAt(x, y, z).setType(Material.AIR);
435                                                                                    
436                                  }                                  }

Legend:
Removed from v.3139  
changed lines
  Added in v.3204

  ViewVC Help
Powered by ViewVC 1.1.20