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) ) { |
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]); |
390 |
|
|
391 |
} |
} |
392 |
} |
} |
393 |
|
|
394 |
|
|
395 |
|
|
396 |
private void resetMap(boolean[][] map) { |
private void resetMap(boolean[][] map) { |