--- miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/TemplateCommand.java 2012/03/19 08:09:08 1752 +++ miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/TemplateCommand.java 2012/03/19 10:18:44 1756 @@ -53,7 +53,7 @@ return true; } - File templateFile = new File( plugin.getDataFolder(), "template_" + args[0] + ".txt"); + File templateFile = new File( plugin.getDataFolder(), "templates/" + args[0] + ".txt"); if (! templateFile.exists() ) { sender.sendMessage( ChatColor.YELLOW + "Template not found" ); return true; @@ -122,6 +122,10 @@ if (line.charAt(0) == '-') continue; + + if ( y >= ysize) { + throw new Exception( "Template: found more levels in file than specified in header" ); + } String elements[] = line.split(","); if (elements.length != zsize) { @@ -224,6 +228,10 @@ continue; if (type == 68) // sign continue; + if (type == 65) // ladder + continue; + if (type == 67) // steps + continue; } world.getBlockAt(x, y, z).setTypeIdAndData(type, data, true);