--- miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/creative/GeneralContractorCommands.java 2016/11/18 19:39:02 3138 +++ miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/creative/GeneralContractorCommands.java 2016/11/18 20:50:34 3139 @@ -263,6 +263,7 @@ for (int z=(playerZ-radius); z<=(playerZ+radius); z++) { //int y = getGroundLevel(x,z) - 1; int y = world.getHighestBlockYAt(x, z) ; + y -= 1; world.getBlockAt(x, y, z).setType(material); } @@ -289,14 +290,12 @@ } if (split.length == 2) { - int id; - try { - id = Integer.parseInt( split[1] ); - } catch (Exception e) { + Material material = Material.matchMaterial( split[1] ); + if (material == null) { player.sendMessage(label + ": id must be an integer"); return false; } - if ( id == 46) { + if ( material == Material.TNT) { player.sendMessage("Sorry dave, i can't do that"); return false; }