--- miscJava/minecraft-plugins/hoeruputils/src/HoerupUtils.java 2010/10/19 17:16:40 1174 +++ miscJava/minecraft-plugins/hoeruputils/src/HoerupUtils.java 2010/10/19 17:56:15 1175 @@ -73,12 +73,80 @@ } else if (split[0].equals("/levelarea") && player.canUseCommand("/levelarea")) { levelArea(player, split); return true; + } else if (split[0].equals("/setsurface") && player.canUseCommand("/setsurface")) { + setSurface(player,split); + return true; } else { return false; } } + private void setSurface(Player player, String[] split) { + int valid_block_array[] = {1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 35, 41, 42, 43, 44, 45, 46, 48, 49, 56, 57, 73, 74, 79, 80, 82} ; + + final int BLOCK_MAX = 86; + + if (split.length != 3) { + player.sendMessage("Usage /setsurface "); + return; + } + + + int radius; + try { + radius = Integer.parseInt(split[1]); + } catch (Exception e) { + player.sendMessage("setsurface: radius must be an integer"); + return; + } + + if (radius > 20) { + player.sendMessage("setsurface: radius may not exceed 20"); + return; + } + + + int blockid; + try { + blockid = Integer.parseInt(split[2]); + } catch (Exception e) { + player.sendMessage("setsurface: blockid must be an integer"); + return; + } + + boolean validblock = false; + for (int i=0; i"); @@ -99,6 +167,7 @@ } + System.out.println("Player " + player.getName() + " used levelarea with radius=" + radius);