import "io" for File, Directory import "os" for Process class Generator { // path needs to end with a / static woodType(namespace, name, path, warn, verbose){ if(!path.endsWith("/")) path = path + "/" var bspath = path + "assets/" + namespace + "/blockstates/" var bmpath = path + "assets/" + namespace + "/models/block/" var impath = path + "assets/" + namespace + "/models/item/" var lootpath = path + "data/" + namespace + "/loot_tables/blocks/" var recipepath = path + "data/" + namespace + "/recipes/" var advpath = path + "data/" + namespace + "/advancements/recipes/" var btagpath = path + "data/" + namespace + "/tags/blocks/" var itagpath = path + "data/" + namespace + "/tags/items/" namespace = namespace + ":" var nsblock = namespace + "block/" + name var nsitem = namespace + "item/" + name var nsid = namespace + name var pth if(Directory.exists(bspath)){ pth = bspath + name + "_button.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = nsblock + "_button" file.writeBytes("{\"variants\":{\"face=floor,facing=east,powered=false\":{\"model\":\"" + r + "\",\"y\":90},\"face=floor,facing=west,powered=false\":{\"model\":\"" + r + "\",\"y\":270},\"face=floor,facing=south,powered=false\":{\"model\":\"" + r + "\",\"y\":180},\"face=floor,facing=north,powered=false\":{\"model\":\"" + r + "\"},\"face=wall,facing=east,powered=false\":{\"model\":\"" + r + "\",\"uvlock\":true,\"x\":90,\"y\":90},\"face=wall,facing=west,powered=false\":{\"model\":\"" + r + "\",\"uvlock\":true,\"x\":90,\"y\":270},\"face=wall,facing=south,powered=false\":{\"model\":\"" + r + "\",\"uvlock\":true,\"x\":90,\"y\":180},\"face=wall,facing=north,powered=false\":{\"model\":\"" + r + "\",\"uvlock\":true,\"x\":90},\"face=ceiling,facing=east,powered=false\":{\"model\":\"" + r + "\",\"x\":180,\"y\":270},\"face=ceiling,facing=west,powered=false\":{\"model\":\"" + r + "\",\"x\":180,\"y\":90},\"face=ceiling,facing=south,powered=false\":{\"model\":\"" + r + "\",\"x\":180},\"face=ceiling,facing=north,powered=false\":{\"model\":\"" + r + "\",\"x\":180,\"y\":180},\"face=floor,facing=east,powered=true\":{\"model\":\"" + r + "_pressed\",\"y\":90},\"face=floor,facing=west,powered=true\":{\"model\":\"" + r + "_pressed\",\"y\":270},\"face=floor,facing=south,powered=true\":{\"model\":\"" + r + "_pressed\",\"y\":180},\"face=floor,facing=north,powered=true\":{\"model\":\"" + r + "_pressed\"},\"face=wall,facing=east,powered=true\":{\"model\":\"" + r + "_pressed\",\"uvlock\":true,\"x\":90,\"y\":90},\"face=wall,facing=west,powered=true\":{\"model\":\"" + r + "_pressed\",\"uvlock\":true,\"x\":90,\"y\":270},\"face=wall,facing=south,powered=true\":{\"model\":\"" + r + "_pressed\",\"uvlock\":true,\"x\":90,\"y\":180},\"face=wall,facing=north,powered=true\":{\"model\":\"" + r + "_pressed\",\"uvlock\":true,\"x\":90},\"face=ceiling,facing=east,powered=true\":{\"model\":\"" + r + "_pressed\",\"x\":180,\"y\":270},\"face=ceiling,facing=west,powered=true\":{\"model\":\"" + r + "_pressed\",\"x\":180,\"y\":90},\"face=ceiling,facing=south,powered=true\":{\"model\":\"" + r + "_pressed\",\"x\":180},\"face=ceiling,facing=north,powered=true\":{\"model\":\"" + r + "_pressed\",\"x\":180,\"y\":180}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + name + "_door.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = nsblock + "_door" file.writeBytes("{\"variants\":{\"facing=east,half=lower,hinge=left,open=false\":{\"model\":\"" + r + "_bottom\"},\"facing=south,half=lower,hinge=left,open=false\":{\"model\":\"" + r + "_bottom\",\"y\":90},\"facing=west,half=lower,hinge=left,open=false\":{\"model\":\"" + r + "_bottom\",\"y\":180},\"facing=north,half=lower,hinge=left,open=false\":{\"model\":\"" + r + "_bottom\",\"y\":270},\"facing=east,half=lower,hinge=right,open=false\":{\"model\":\"" + r + "_bottom_hinge\"},\"facing=south,half=lower,hinge=right,open=false\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":90},\"facing=west,half=lower,hinge=right,open=false\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":180},\"facing=north,half=lower,hinge=right,open=false\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":270},\"facing=east,half=lower,hinge=left,open=true\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":90},\"facing=south,half=lower,hinge=left,open=true\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":180},\"facing=west,half=lower,hinge=left,open=true\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":270},\"facing=north,half=lower,hinge=left,open=true\":{\"model\":\"" + r + "_bottom_hinge\"},\"facing=east,half=lower,hinge=right,open=true\":{\"model\":\"" + r + "_bottom\",\"y\":270},\"facing=south,half=lower,hinge=right,open=true\":{\"model\":\"" + r + "_bottom\"},\"facing=west,half=lower,hinge=right,open=true\":{\"model\":\"" + r + "_bottom\",\"y\":90},\"facing=north,half=lower,hinge=right,open=true\":{\"model\":\"" + r + "_bottom\",\"y\":180},\"facing=east,half=upper,hinge=left,open=false\":{\"model\":\"" + r + "_top\"},\"facing=south,half=upper,hinge=left,open=false\":{\"model\":\"" + r + "_top\",\"y\":90},\"facing=west,half=upper,hinge=left,open=false\":{\"model\":\"" + r + "_top\",\"y\":180},\"facing=north,half=upper,hinge=left,open=false\":{\"model\":\"" + r + "_top\",\"y\":270},\"facing=east,half=upper,hinge=right,open=false\":{\"model\":\"" + r + "_top_hinge\"},\"facing=south,half=upper,hinge=right,open=false\":{\"model\":\"" + r + "_top_hinge\",\"y\":90},\"facing=west,half=upper,hinge=right,open=false\":{\"model\":\"" + r + "_top_hinge\",\"y\":180},\"facing=north,half=upper,hinge=right,open=false\":{\"model\":\"" + r + "_top_hinge\",\"y\":270},\"facing=east,half=upper,hinge=left,open=true\":{\"model\":\"" + r + "_top_hinge\",\"y\":90},\"facing=south,half=upper,hinge=left,open=true\":{\"model\":\"" + r + "_top_hinge\",\"y\":180},\"facing=west,half=upper,hinge=left,open=true\":{\"model\":\"" + r + "_top_hinge\",\"y\":270},\"facing=north,half=upper,hinge=left,open=true\":{\"model\":\"" + r + "_top_hinge\"},\"facing=east,half=upper,hinge=right,open=true\":{\"model\":\"" + r + "_top\",\"y\":270},\"facing=south,half=upper,hinge=right,open=true\":{\"model\":\"" + r + "_top\"},\"facing=west,half=upper,hinge=right,open=true\":{\"model\":\"" + r + "_top\",\"y\":90},\"facing=north,half=upper,hinge=right,open=true\":{\"model\":\"" + r + "_top\",\"y\":180}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + name + "_fence.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = nsblock + "_fence" file.writeBytes("{\"multipart\":[{\"apply\":{\"model\":\"" + r + "_post\"}},{\"when\":{\"north\":\"true\"},\"apply\":{\"model\":\"" + r + "_side\",\"uvlock\":true}},{\"when\":{\"east\":\"true\"},\"apply\":{\"model\":\"" + r + "_side\",\"y\":90,\"uvlock\":true}},{\"when\":{\"south\":\"true\"},\"apply\":{\"model\":\"" + r + "_side\",\"y\":180,\"uvlock\":true}},{\"when\":{\"west\":\"true\"},\"apply\":{\"model\":\"" + r + "_side\",\"y\":270,\"uvlock\":true}}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + name + "_fence_gate.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = nsblock + "_fence_gate" file.writeBytes("{\"variants\":{\"facing=south,in_wall=false,open=false\":{\"model\":\"" + r + "\",\"uvlock\":true},\"facing=west,in_wall=false,open=false\":{\"model\":\"" + r + "\",\"uvlock\":true,\"y\":90},\"facing=north,in_wall=false,open=false\":{\"model\":\"" + r + "\",\"uvlock\":true,\"y\":180},\"facing=east,in_wall=false,open=false\":{\"model\":\"" + r + "\",\"uvlock\":true,\"y\":270},\"facing=south,in_wall=false,open=true\":{\"model\":\"" + r + "_open\",\"uvlock\":true},\"facing=west,in_wall=false,open=true\":{\"model\":\"" + r + "_open\",\"uvlock\":true,\"y\":90},\"facing=north,in_wall=false,open=true\":{\"model\":\"" + r + "_open\",\"uvlock\":true,\"y\":180},\"facing=east,in_wall=false,open=true\":{\"model\":\"" + r + "_open\",\"uvlock\":true,\"y\":270},\"facing=south,in_wall=true,open=false\":{\"model\":\"" + r + "_wall\",\"uvlock\":true},\"facing=west,in_wall=true,open=false\":{\"model\":\"" + r + "_wall\",\"uvlock\":true,\"y\":90},\"facing=north,in_wall=true,open=false\":{\"model\":\"" + r + "_wall\",\"uvlock\":true,\"y\":180},\"facing=east,in_wall=true,open=false\":{\"model\":\"" + r + "_wall\",\"uvlock\":true,\"y\":270},\"facing=south,in_wall=true,open=true\":{\"model\":\"" + r + "_wall_open\",\"uvlock\":true},\"facing=west,in_wall=true,open=true\":{\"model\":\"" + r + "_wall_open\",\"uvlock\":true,\"y\":90},\"facing=north,in_wall=true,open=true\":{\"model\":\"" + r + "_wall_open\",\"uvlock\":true,\"y\":180},\"facing=east,in_wall=true,open=true\":{\"model\":\"" + r + "_wall_open\",\"uvlock\":true,\"y\":270}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + name + "_leaves.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + nsblock + "_leaves\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + name + "_log.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = nsblock + "_log" file.writeBytes("{\"variants\":{\"axis=x\":{\"model\":\"" + r + "\",\"x\":90,\"y\":90},\"axis=y\":{\"model\":\"" + r + "\"},\"axis=z\":{\"model\":\"" + r + "\",\"x\":90}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + name + "_planks.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + nsblock + "_planks\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + name + "_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + nsblock + "_platform\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + name + "_pressure_plate.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = nsblock + "_pressure_plate" file.writeBytes("{\"variants\":{\"powered=false\":{\"model\":\"" + r + "\"},\"powered=true\":{\"model\":\"" + r + "_down\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + name + "_sapling.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + nsblock + "_sapling\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + name + "_sign.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + nsblock + "_sign\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + name + "_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"variants\":{\"type=bottom\":{\"model\":\"" + nsblock + "_slab\"},\"type=top\":{\"model\":\"" + nsblock + "_slab_top\"},\"type=double\":{\"model\":\"" + nsblock + "_planks\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + name + "_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = nsblock + "_stairs" file.writeBytes("{\"variants\":{\"facing=east,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\"},\"facing=east,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\"},\"facing=east,half=bottom,shape=straight\":{\"model\":\"" + r + "\"},\"facing=east,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=south,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\"},\"facing=south,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\"},\"facing=south,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":180,\"uvlock\":true}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + name + "_trapdoor.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = nsblock + "_trapdoor" file.writeBytes("{\"variants\":{\"facing=east,half=bottom,open=false\":{\"model\":\"" + r + "\",\"y\":90},\"facing=east,half=bottom,open=true\":{\"model\":\"" + r + "\",\"x\":270,\"y\":270},\"facing=east,half=top,open=false\":{\"model\":\"" + r + "\",\"x\":180,\"y\":270},\"facing=east,half=top,open=true\":{\"model\":\"" + r + "\",\"x\":90,\"y\":90},\"facing=north,half=bottom,open=false\":{\"model\":\"" + r + "\"},\"facing=north,half=bottom,open=true\":{\"model\":\"" + r + "\",\"x\":270,\"y\":180},\"facing=north,half=top,open=false\":{\"model\":\"" + r + "\",\"x\":180,\"y\":180},\"facing=north,half=top,open=true\":{\"model\":\"" + r + "\",\"x\":90},\"facing=south,half=bottom,open=false\":{\"model\":\"" + r + "\",\"y\":180},\"facing=south,half=bottom,open=true\":{\"model\":\"" + r + "\",\"x\":270},\"facing=south,half=top,open=false\":{\"model\":\"" + r + "\",\"x\":180},\"facing=south,half=top,open=true\":{\"model\":\"" + r + "\",\"x\":90,\"y\":180},\"facing=west,half=bottom,open=false\":{\"model\":\"" + r + "\",\"y\":270},\"facing=west,half=bottom,open=true\":{\"model\":\"" + r + "\",\"x\":270,\"y\":90},\"facing=west,half=top,open=false\":{\"model\":\"" + r + "\",\"x\":180,\"y\":90},\"facing=west,half=top,open=true\":{\"model\":\"" + r + "\",\"x\":90,\"y\":270}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + name + "_wall_fence.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = nsblock + "_wall_fence" file.writeBytes("{\"variants\":{\"north=false,east=false,south=false,west=false\":{\"model\":\"minecraft:block/air\"},\"north=true,east=false,south=false,west=false\":{\"model\":\"" + r + "\"},\"north=false,east=true,south=false,west=false\":{\"model\":\"" + r + "\",\"y\":90},\"north=false,east=false,south=true,west=false\":{\"model\":\"" + r + "\",\"y\":180},\"north=false,east=false,south=false,west=true\":{\"model\":\"" + r + "\",\"y\":270},\"north=true,east=false,south=false,west=true\":{\"model\":\"" + r + "_corner\"},\"north=true,east=true,south=false,west=false\":{\"model\":\"" + r + "_corner\",\"y\":90},\"north=false,east=true,south=true,west=false\":{\"model\":\"" + r + "_corner\",\"y\":180},\"north=false,east=false,south=true,west=true\":{\"model\":\"" + r + "_corner\",\"y\":270},\"north=true,east=false,south=true,west=false\":{\"model\":\"" + r + "_opposite\"},\"north=false,east=true,south=false,west=true\":{\"model\":\"" + r + "_opposite\",\"y\":90},\"north=true,east=true,south=false,west=true\":{\"model\":\"" + r + "_three\"},\"north=true,east=true,south=true,west=false\":{\"model\":\"" + r + "_three\",\"y\":90},\"north=false,east=true,south=true,west=true\":{\"model\":\"" + r + "_three\",\"y\":180},\"north=true,east=false,south=true,west=true\":{\"model\":\"" + r + "_three\",\"y\":270},\"north=true,east=true,south=true,west=true\":{\"model\":\"" + r + "_four\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + name + "_wall_hedge.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = nsblock + "_wall_hedge" file.writeBytes("{\"variants\":{\"north=false,east=false,south=false,west=false\":{\"model\":\"minecraft:block/air\"},\"north=true,east=false,south=false,west=false\":{\"model\":\"" + r + "\"},\"north=false,east=true,south=false,west=false\":{\"model\":\"" + r + "\",\"y\":90,\"uvlock\":true},\"north=false,east=false,south=true,west=false\":{\"model\":\"" + r + "\",\"y\":180,\"uvlock\":true},\"north=false,east=false,south=false,west=true\":{\"model\":\"" + r + "\",\"y\":270,\"uvlock\":true},\"north=true,east=false,south=false,west=true\":{\"model\":\"" + r + "_corner\"},\"north=true,east=true,south=false,west=false\":{\"model\":\"" + r + "_corner\",\"y\":90,\"uvlock\":true},\"north=false,east=true,south=true,west=false\":{\"model\":\"" + r + "_corner\",\"y\":180,\"uvlock\":true},\"north=false,east=false,south=true,west=true\":{\"model\":\"" + r + "_corner\",\"y\":270,\"uvlock\":true},\"north=true,east=false,south=true,west=false\":{\"model\":\"" + r + "_opposite\"},\"north=false,east=true,south=false,west=true\":{\"model\":\"" + r + "_opposite\",\"y\":90,\"uvlock\":true},\"north=true,east=true,south=false,west=true\":{\"model\":\"" + r + "_three\"},\"north=true,east=true,south=true,west=false\":{\"model\":\"" + r + "_three\",\"y\":90,\"uvlock\":true},\"north=false,east=true,south=true,west=true\":{\"model\":\"" + r + "_three\",\"y\":180,\"uvlock\":true},\"north=true,east=false,south=true,west=true\":{\"model\":\"" + r + "_three\",\"y\":270,\"uvlock\":true},\"north=true,east=true,south=true,west=true\":{\"model\":\"" + r + "_four\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + name + "_wall_sign.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + nsblock + "_sign\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + name + "_wood.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = nsblock + "_wood" file.writeBytes("{\"variants\":{\"axis=x\":{\"model\":\"" + r + "\",\"x\":90,\"y\":90},\"axis=y\":{\"model\":\"" + r + "\"},\"axis=z\":{\"model\":\"" + r + "\",\"x\":90}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + "large_" + name + "_tile_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + namespace + "block/large_" + name + "_tile_platform" + "\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + "large_" + name + "_tile_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = namespace + "block/large_" + name + "_tile" file.writeBytes("{\"variants\":{\"type=bottom\":{\"model\":\"" + r + "_slab\"},\"type=top\":{\"model\":\"" + r + "_slab_top\"},\"type=double\":{\"model\":\"" + r + "s\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + "large_" + name + "_tile_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = namespace + "block/large_" + name + "_tile_stairs" file.writeBytes("{\"variants\":{\"facing=east,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\"},\"facing=east,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\"},\"facing=east,half=bottom,shape=straight\":{\"model\":\"" + r + "\"},\"facing=east,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=south,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\"},\"facing=south,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\"},\"facing=south,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":180,\"uvlock\":true}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + "large_" + name + "_tiles.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + namespace + "block/large_" + name + "_tiles" + "\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + "potted_" + name + "_sapling.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + namespace + "block/potted_" + name + "_sapling\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + "small_" + name + "_tile_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + namespace + "block/small_" + name + "_tile_platform" + "\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + "small_" + name + "_tile_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = namespace + "block/small_" + name + "_tile" file.writeBytes("{\"variants\":{\"type=bottom\":{\"model\":\"" + r + "_slab\"},\"type=top\":{\"model\":\"" + r + "_slab_top\"},\"type=double\":{\"model\":\"" + r + "s\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + "small_" + name + "_tile_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = namespace + "block/small_" + name + "_tile_stairs" file.writeBytes("{\"variants\":{\"facing=east,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\"},\"facing=east,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\"},\"facing=east,half=bottom,shape=straight\":{\"model\":\"" + r + "\"},\"facing=east,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=south,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\"},\"facing=south,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\"},\"facing=south,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":180,\"uvlock\":true}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + "small_" + name + "_tiles.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + namespace + "block/small_" + name + "_tiles" + "\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + "stripped_" + name + "_log.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = namespace + "block/stripped_" + name + "_log" file.writeBytes("{\"variants\":{\"axis=x\":{\"model\":\"" + r + "\",\"x\":90,\"y\":90},\"axis=y\":{\"model\":\"" + r + "\"},\"axis=z\":{\"model\":\"" + r + "\",\"x\":90}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + "stripped_" + name + "_wood.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = namespace + "block/stripped_" + name + "_wood" file.writeBytes("{\"variants\":{\"axis=x\":{\"model\":\"" + r + "\",\"x\":90,\"y\":90},\"axis=y\":{\"model\":\"" + r + "\"},\"axis=z\":{\"model\":\"" + r + "\",\"x\":90}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + "windowed_" + name + "_door.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = namespace + "block/windowed_" + name + "_door" file.writeBytes("{\"variants\":{\"facing=east,half=lower,hinge=left,open=false\":{\"model\":\"" + r + "_bottom\"},\"facing=south,half=lower,hinge=left,open=false\":{\"model\":\"" + r + "_bottom\",\"y\":90},\"facing=west,half=lower,hinge=left,open=false\":{\"model\":\"" + r + "_bottom\",\"y\":180},\"facing=north,half=lower,hinge=left,open=false\":{\"model\":\"" + r + "_bottom\",\"y\":270},\"facing=east,half=lower,hinge=right,open=false\":{\"model\":\"" + r + "_bottom_hinge\"},\"facing=south,half=lower,hinge=right,open=false\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":90},\"facing=west,half=lower,hinge=right,open=false\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":180},\"facing=north,half=lower,hinge=right,open=false\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":270},\"facing=east,half=lower,hinge=left,open=true\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":90},\"facing=south,half=lower,hinge=left,open=true\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":180},\"facing=west,half=lower,hinge=left,open=true\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":270},\"facing=north,half=lower,hinge=left,open=true\":{\"model\":\"" + r + "_bottom_hinge\"},\"facing=east,half=lower,hinge=right,open=true\":{\"model\":\"" + r + "_bottom\",\"y\":270},\"facing=south,half=lower,hinge=right,open=true\":{\"model\":\"" + r + "_bottom\"},\"facing=west,half=lower,hinge=right,open=true\":{\"model\":\"" + r + "_bottom\",\"y\":90},\"facing=north,half=lower,hinge=right,open=true\":{\"model\":\"" + r + "_bottom\",\"y\":180},\"facing=east,half=upper,hinge=left,open=false\":{\"model\":\"" + r + "_top\"},\"facing=south,half=upper,hinge=left,open=false\":{\"model\":\"" + r + "_top\",\"y\":90},\"facing=west,half=upper,hinge=left,open=false\":{\"model\":\"" + r + "_top\",\"y\":180},\"facing=north,half=upper,hinge=left,open=false\":{\"model\":\"" + r + "_top\",\"y\":270},\"facing=east,half=upper,hinge=right,open=false\":{\"model\":\"" + r + "_top_hinge\"},\"facing=south,half=upper,hinge=right,open=false\":{\"model\":\"" + r + "_top_hinge\",\"y\":90},\"facing=west,half=upper,hinge=right,open=false\":{\"model\":\"" + r + "_top_hinge\",\"y\":180},\"facing=north,half=upper,hinge=right,open=false\":{\"model\":\"" + r + "_top_hinge\",\"y\":270},\"facing=east,half=upper,hinge=left,open=true\":{\"model\":\"" + r + "_top_hinge\",\"y\":90},\"facing=south,half=upper,hinge=left,open=true\":{\"model\":\"" + r + "_top_hinge\",\"y\":180},\"facing=west,half=upper,hinge=left,open=true\":{\"model\":\"" + r + "_top_hinge\",\"y\":270},\"facing=north,half=upper,hinge=left,open=true\":{\"model\":\"" + r + "_top_hinge\"},\"facing=east,half=upper,hinge=right,open=true\":{\"model\":\"" + r + "_top\",\"y\":270},\"facing=south,half=upper,hinge=right,open=true\":{\"model\":\"" + r + "_top\"},\"facing=west,half=upper,hinge=right,open=true\":{\"model\":\"" + r + "_top\",\"y\":90},\"facing=north,half=upper,hinge=right,open=true\":{\"model\":\"" + r + "_top\",\"y\":180}}}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(bspath)\"! No block state files will be written.") if(Directory.exists(bmpath)){ pth = bmpath + name + "_button.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/button\",\"textures\":{\"texture\":\"" + nsblock + "_planks\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_button_pressed.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/button_pressed\",\"textures\":{\"texture\":\"" + nsblock + "_planks\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_door_bottom.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/door_bottom\",\"textures\":{\"top\":\"" + nsblock + "_door_top\",\"bottom\":\"" + nsblock + "_door_bottom\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_door_bottom_hinge.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/door_bottom_rh\",\"textures\":{\"top\":\"" + nsblock + "_door_top\",\"bottom\":\"" + nsblock + "_door_bottom\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_door_top.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/door_top\",\"textures\":{\"top\":\"" + nsblock + "_door_top\",\"bottom\":\"" + nsblock + "_door_bottom\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_door_top_hinge.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/door_top_rh\",\"textures\":{\"top\":\"" + nsblock + "_door_top\",\"bottom\":\"" + nsblock + "_door_bottom\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_fence_gate.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/template_fence_gate\",\"textures\":{\"texture\":\"" + nsblock + "_planks\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_fence_gate_open.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/template_fence_gate_open\",\"textures\":{\"texture\":\"" + nsblock + "_planks\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_fence_gate_wall.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/template_fence_gate_wall\",\"textures\":{\"texture\":\"" + nsblock + "_planks\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_fence_gate_wall_open.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/template_fence_gate_wall_open\",\"textures\":{\"texture\":\"" + nsblock + "_planks\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_fence_post.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/fence_post\",\"textures\":{\"texture\":\"" + nsblock + "_planks\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_fence_side.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/fence_side\",\"textures\":{\"texture\":\"" + nsblock + "_planks\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_leaves.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/cube_all\",\"textures\":{\"all\":\"" + nsblock + "_leaves\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_log.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/cube_column\",\"textures\":{\"end\":\"" + nsblock + "_log_top\",\"side\":\"" + nsblock + "_log\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_planks.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/cube_all\",\"textures\":{\"all\":\"" + nsblock + "_planks\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"ellas_mod:block/platform\",\"textures\":{\"particle\":\"" + nsblock + "_planks\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_pressure_plate.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/pressure_plate_up\",\"textures\":{\"texture\":\"" + nsblock + "_planks\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_pressure_plate_down.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/pressure_plate_down\",\"textures\":{\"texture\":\"" + nsblock + "_planks\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_sapling.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/cross\",\"textures\":{\"cross\":\"" + nsblock + "_sapling\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_sign.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"textures\":{\"particle\":\"" + namespace + "entity/signs/" + name + "\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/slab\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "_planks\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_slab_top.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/slab_top\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "_planks\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "_planks\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_stairs_inner.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/inner_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "_planks\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_stairs_outer.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/outer_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "_planks\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_trapdoor.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/template_orientable_trapdoor_bottom\",\"textures\":{\"texture\":\"" + nsblock + "_trapdoor\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_wall_fence.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"ellas_mod:block/wall_fence\",\"textures\":{\"particle\":\"" + nsblock + "_wall_fence\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_wall_fence_corner.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"ellas_mod:block/wall_fence_corner\",\"textures\":{\"particle\":\"" + nsblock + "_wall_fence\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_wall_fence_four.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"ellas_mod:block/wall_fence_four\",\"textures\":{\"particle\":\"" + nsblock + "_wall_fence\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_wall_fence_opposite.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"ellas_mod:block/wall_fence_opposite\",\"textures\":{\"particle\":\"" + nsblock + "_wall_fence\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_wall_fence_three.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"ellas_mod:block/wall_fence_three\",\"textures\":{\"particle\":\"" + nsblock + "_wall_fence\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_wall_hedge.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"ellas_mod:block/untinted_wall_hedge\",\"textures\":{\"particle\":\"" + nsblock + "_leaves\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_wall_hedge_corner.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"ellas_mod:block/untinted_wall_hedge_corner\",\"textures\":{\"particle\":\"" + nsblock + "_leaves\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_wall_hedge_four.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"ellas_mod:block/untinted_wall_hedge_four\",\"textures\":{\"particle\":\"" + nsblock + "_leaves\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_wall_hedge_opposite.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"ellas_mod:block/untinted_wall_hedge_opposite\",\"textures\":{\"particle\":\"" + nsblock + "_leaves\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_wall_hedge_three.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"ellas_mod:block/untinted_wall_hedge_three\",\"textures\":{\"particle\":\"" + nsblock + "_leaves\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_wood.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/cube_all\",\"textures\":{\"all\":\"" + nsblock + "_wood\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "large_" + name + "_tile_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"ellas_mod:block/platform\",\"textures\":{\"particle\":\"" + namespace + "block/large_" + name + "_tiles\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "large_" + name + "_tile_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/slab\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/large_" + name + "_tiles\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "large_" + name + "_tile_slab_top.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/slab_top\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/large_" + name + "_tiles\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "large_" + name + "_tile_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/large_" + name + "_tiles\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "large_" + name + "_tile_stairs_inner.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/inner_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/large_" + name + "_tiles\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "large_" + name + "_tile_stairs_outer.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/outer_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/large_" + name + "_tiles\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "large_" + name + "_tiles.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/cube_all\",\"textures\":{\"all\":\"" + namespace + "block/large_" + name + "_tiles" + "\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "potted_" + name + "_sapling.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/flower_pot_cross\",\"textures\":{\"plant\":\"" + namespace + "block/" + name + "_sapling\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "small_" + name + "_tile_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/cube_all\",\"textures\":{\"particle\":\"" + namespace + "block/small_" + name + "_tiles" + "\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "small_" + name + "_tile_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/slab\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/small_" + name + "_tiles\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "small_" + name + "_tile_slab_top.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/slab_top\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/small_" + name + "_tiles\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "small_" + name + "_tile_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/small_" + name + "_tiles\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "small_" + name + "_tile_stairs_inner.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/inner_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/small_" + name + "_tiles\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "small_" + name + "_tile_stairs_outer.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/outer_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/small_" + name + "_tiles\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "small_" + name + "_tiles.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/cube_all\",\"textures\":{\"all\":\"" + namespace + "block/small_" + name + "_tiles\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "stripped_" + name + "_log.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = namespace + "block/stripped_" + name + "_log" file.writeBytes("{\"parent\":\"minecraft:block/cube_column\",\"textures\":{\"end\":\"" + r + "_top\",\"side\":\"" + r + "\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "stripped_" + name + "_wood.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/cube_all\",\"textures\":{\"all\":\"" + namespace + "block/stripped_" + name + "_log\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "windowed_" + name + "_door_bottom.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = namespace + "block/windowed_" + name file.writeBytes("{\"parent\":\"minecraft:block/door_bottom\",\"textures\":{\"top\":\"" + r + "_door_top\",\"bottom\":\"" + r + "_door_bottom\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "windowed_" + name + "_door_bottom_hinge.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = namespace + "block/windowed_" + name file.writeBytes("{\"parent\":\"minecraft:block/door_bottom_rh\",\"textures\":{\"top\":\"" + r + "_door_top\",\"bottom\":\"" + r + "_door_bottom\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "windowed_" + name + "_door_top.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = namespace + "block/windowed_" + name file.writeBytes("{\"parent\":\"minecraft:block/door_top\",\"textures\":{\"top\":\"" + r + "_door_top\",\"bottom\":\"" + r + "_door_bottom\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "windowed_" + name + "_door_top_hinge.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = namespace + "block/windowed_" + name file.writeBytes("{\"parent\":\"minecraft:block/door_top_rh\",\"textures\":{\"top\":\"" + r + "_door_top\",\"bottom\":\"" + r + "_door_bottom\"}}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(bmpath)\"! No block model files will be written.") if(Directory.exists(impath)){ pth = impath + name + "_boat.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:item/generated\",\"textures\":{\"layer0\":\"" + nsitem + "_boat\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + name + "_button.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/button_inventory\",\"textures\":{\"texture\":\"" + nsblock + "_planks\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + name + "_door.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:item/generated\",\"textures\":{\"layer0\":\"" + nsitem + "_door\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + name + "_fence.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/fence_inventory\",\"textures\":{\"texture\":\"" + nsblock + "_planks\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + name + "_fence_gate.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + nsblock + "_fence_gate\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + name + "_leaves.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + nsblock + "_leaves\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + name + "_log.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + nsblock + "_log\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + name + "_planks.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + nsblock + "_planks\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + name + "_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + nsblock + "_platform\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + name + "_pressure_plate.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + nsblock + "_pressure_plate\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + name + "_sapling.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:item/generated\",\"textures\":{\"layer0\":\"" + nsblock + "_sapling\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + name + "_sign.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:item/generated\",\"textures\":{\"layer0\":\"" + nsitem + "_sign\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + name + "_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + nsblock + "_slab\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + name + "_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + nsblock + "_stairs\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + name + "_trapdoor.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + nsblock + "_trapdoor\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + name + "_wall_fence.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + nsblock + "_wall_fence\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + name + "_wall_hedge.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + nsblock + "_wall_hedge\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + name + "_wood.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + nsblock + "_wood\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + "large_" + name + "_tile_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + namespace + "block/large_" + name + "_tile_platform\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + "large_" + name + "_tile_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + namespace + "block/large_" + name + "_tile_slab\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + "large_" + name + "_tile_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + namespace + "block/large_" + name + "_tile_stairs\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + "large_" + name + "_tiles.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + namespace + "block/large_" + name + "_tiles\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + "small_" + name + "_tile_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + namespace + "block/small_" + name + "_tile_platform\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + "small_" + name + "_tile_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + namespace + "block/small_" + name + "_tile_slab\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + "small_" + name + "_tile_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + namespace + "block/small_" + name + "_tile_stairs\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + "small_" + name + "_tiles.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + namespace + "block/small_" + name + "_tiles\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + "stripped_" + name + "_log.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + namespace + "block/stripped_" + name + "_log\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + "stripped_" + name + "_wood.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + namespace + "block/stripped_" + name + "_wood\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + "windowed_" + name + "_door.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:item/generated\",\"textures\":{\"layer0\":\"" + namespace + "item/windowed_" + name + "_door\"}}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(impath)\"! No item model files will be written.") if(Directory.exists(recipepath)){ pth = recipepath + name + "_boat.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"boat\",\"pattern\":[\"# #\",\"###\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_planks\"}},\"result\":{\"item\":\"" + nsid + "_boat\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + name + "_button.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shapeless\",\"group\":\"wooden_button\",\"ingredients\":[{\"item\":\"" + nsid + "_planks\"}],\"result\":{\"item\":\"" + nsid + "_button\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + name + "_door.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"wooden_door\",\"pattern\":[\"##\",\"##\",\"##\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_planks\"}},\"result\":{\"item\":\"" + nsid + "_door\",\"count\":3}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + name + "_fence.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"wooden_fence\",\"pattern\":[\"#/#\",\"#/#\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_planks\"},\"/\":{\"item\":\"minecraft:stick\"}},\"result\":{\"item\":\"" + nsid + "_fence\",\"count\":3}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + name + "_fence_gate.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"wooden_fence\",\"pattern\":[\"/#/\",\"/#/\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_planks\"},\"/\":{\"item\":\"minecraft:stick\"}},\"result\":{\"item\":\"" + nsid + "_fence_gate\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + name + "_planks.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shapeless\",\"group\":\"planks\",\"ingredients\":[{\"tag\":\"" + nsid + "_logs\"}],\"result\":{\"item\":\"" + nsid + "_planks\",\"count\":4}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + name + "_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"platform\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_slab\"}},\"result\":{\"item\":\"" + nsid + "_platform\",\"count\":12}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + name + "_pressure_plate.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"wooden_pressure_plate\",\"pattern\":[\"##\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_planks\"}},\"result\":{\"item\":\"" + nsid + "_pressure_plate\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + name + "_sign.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"pattern\":[\"###\",\"###\",\" / \"],\"key\":{\"#\":{\"item\":\"" + nsid + "_planks\"},\"/\":{\"item\":\"minecraft:stick\"}},\"result\":{\"item\":\"" + nsid + "_sign\",\"count\":3}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + name + "_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"wooden_slab\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_planks\"}},\"result\":{\"item\":\"" + nsid + "_slab\",\"count\":6}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + name + "_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"wooden_stairs\",\"pattern\":[\"# \",\"## \",\"###\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_planks\"}},\"result\":{\"item\":\"" + nsid + "_stairs\",\"count\":4}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + name + "_trapdoor.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"wooden_trapdoor\",\"pattern\":[\"###\",\"###\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_planks\"}},\"result\":{\"item\":\"" + nsid + "_trapdoor\",\"count\":2}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + name + "_wall_fence.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"wall_fence\",\"pattern\":[\"#/#\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_planks\"},\"/\":{\"item\":\"minecraft:stick\"}},\"result\":{\"item\":\"" + nsid + "_wall_fence\",\"count\":6}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + name + "_wall_hedge.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"wall_hedge\",\"pattern\":[\"# #\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_leaves\"}},\"result\":{\"item\":\"" + nsid + "_wall_hedge\",\"count\":6}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + name + "_wood.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"bark\",\"pattern\":[\"##\",\"##\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_log\"}},\"result\":{\"item\":\"" + nsid + "_wood\",\"count\":3}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "large_" + name + "_tiles.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tiles\",\"pattern\":[\"# #\",\" \",\"# #\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_planks\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tiles\",\"count\":4}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "large_" + name + "_tile_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tile_platform\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + namespace + "large_" + name + "_tile_slab\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tile_platform\",\"count\":12}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "large_" + name + "_tile_platform_from_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tile_platform_from_platform\",\"pattern\":[\"# #\",\" \",\"# #\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_platform\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tile_platform\",\"count\":4}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "large_" + name + "_tile_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tile_slab\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + namespace + "large_" + name + "_tiles\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tile_slab\",\"count\":6}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "large_" + name + "_tile_slab_from_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tile_slab_from_slab\",\"pattern\":[\"# #\",\" \",\"# #\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_slab\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tile_slab\",\"count\":4}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "large_" + name + "_tile_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tile_stairs\",\"pattern\":[\"# \",\"## \",\"###\"],\"key\":{\"#\":{\"item\":\"" + namespace + "large_" + name + "_tiles\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tile_stairs\",\"count\":4}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "large_" + name + "_tile_stairs_from_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tile_stairs_from_stairs\",\"pattern\":[\"# #\",\" \",\"# #\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_stairs\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tile_stairs\",\"count\":4}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "small_" + name + "_tiles.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"small_wooden_tiles\",\"pattern\":[\"# #\",\" \",\"# #\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_planks\"}},\"result\":{\"item\":\"" + namespace + "small_" + name + "_tiles\",\"count\":4}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "small_" + name + "_tile_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"small_wooden_tile_platform\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + namespace + "small_" + name + "_tile_slab\"}},\"result\":{\"item\":\"" + namespace + "small_" + name + "_tile_platform\",\"count\":12}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "small_" + name + "_tile_platform_from_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shapeless\",\"group\":\"small_wooden_tile_platform_from_platform\",\"ingredients\":[{\"item\":\"" + namespace + "large_" + name + "_tile_platform\"}],\"result\":{\"item\":\"" + namespace + "small_" + name + "_tile_platform\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "small_" + name + "_tile_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"small_wooden_tile_slab\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + namespace + "small_" + name + "_tiles\"}},\"result\":{\"item\":\"" + namespace + "small_" + name + "_tile_slab\",\"count\":6}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "small_" + name + "_tile_slab_from_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shapeless\",\"group\":\"small_wooden_tile_slab_from_slab\",\"ingredients\":[{\"item\":\"" + namespace + "large_" + name + "_tile_slab\"}],\"result\":{\"item\":\"" + namespace + "small_" + name + "_tile_slab\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "small_" + name + "_tile_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"small_wooden_tile_stairs\",\"pattern\":[\"# \",\"## \",\"###\"],\"key\":{\"#\":{\"item\":\"" + namespace + "small_" + name + "_tiles\"}},\"result\":{\"item\":\"" + namespace + "small_" + name + "_tile_stairs\",\"count\":4}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "small_" + name + "_tile_stairs_from_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shapeless\",\"group\":\"small_wooden_tile_slab_from_slab\",\"ingredients\":[{\"item\":\"" + namespace + "large_" + name + "_tile_stairs\"}],\"result\":{\"item\":\"" + namespace + "small_" + name + "_tile_stairs\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "stripped_" + name + "_wood.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"bark\",\"pattern\":[\"##\",\"##\"],\"key\":{\"#\":{\"item\":\"" + namespace + "stripped_" + name + "_log\"}},\"result\":{\"item\":\"" + namespace + "stripped_" + name + "_wood\",\"count\":3}}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(recipepath)\"! No recipe files will be written.") if(Directory.exists(lootpath)){ pth = lootpath + name + "_button.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_button\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + name + "_door.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1.0,\"bonus_rolls\":0.0,\"entries\":[{\"type\":\"minecraft:item\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_door\",\"properties\":{\"half\":\"lower\"}}],\"name\":\"" + nsid + "_door\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + name + "_fence.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_fence\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + name + "_fence_gate.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_fence_gate\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + name + "_leaves.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:alternatives\",\"children\":[{\"type\":\"minecraft:item\",\"conditions\":[{\"condition\":\"minecraft:alternative\",\"terms\":[{\"condition\":\"minecraft:match_tool\",\"predicate\":{\"items\":[\"minecraft:shears\"]}},{\"condition\":\"minecraft:match_tool\",\"predicate\":{\"enchantments\":[{\"enchantment\":\"minecraft:silk_touch\",\"levels\":{\"min\":1}}]}}]}],\"name\":\"" + nsid + "_leaves\"},{\"type\":\"minecraft:item\",\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"},{\"condition\":\"minecraft:table_bonus\",\"enchantment\":\"minecraft:fortune\",\"chances\":[0.05,0.0625,0.083333336,0.1]}],\"name\":\"" + nsid + "_sapling\"}]}]},{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"conditions\":[{\"condition\":\"minecraft:table_bonus\",\"enchantment\":\"minecraft:fortune\",\"chances\":[0.02,0.022222223,0.025,0.033333335,0.1]}],\"functions\":[{\"function\":\"minecraft:set_count\",\"count\":{\"type\":\"minecraft:uniform\",\"min\":1,\"max\":2},\"add\":false},{\"function\":\"minecraft:explosion_decay\"}],\"name\":\"minecraft:stick\"}],\"conditions\":[{\"condition\":\"minecraft:inverted\",\"term\":{\"condition\":\"minecraft:alternative\",\"terms\":[{\"condition\":\"minecraft:match_tool\",\"predicate\":{\"items\":[\"minecraft:shears\"]}},{\"condition\":\"minecraft:match_tool\",\"predicate\":{\"enchantments\":[{\"enchantment\":\"minecraft:silk_touch\",\"levels\":{\"min\":1}}]}}]}}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + name + "_log.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_log\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + name + "_planks.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_planks\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + name + "_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_platform\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + name + "_pressure_plate.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_pressure_plate\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + name + "_sapling.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_sapling\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + name + "_sign.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_sign\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + name + "_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"entries\":[{\"type\":\"minecraft:item\",\"functions\":[{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_slab\",\"properties\":{\"type\":\"double\"}}],\"count\":2},{\"function\":\"minecraft:explosion_decay\"}],\"name\":\"" + nsid + "_slab\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + name + "_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_stairs\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + name + "_trapdoor.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_trapdoor\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + name + "_wall_fence.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"functions\":[{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_fence\",\"properties\":{\"east\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_fence\",\"properties\":{\"west\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_fence\",\"properties\":{\"north\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_fence\",\"properties\":{\"south\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"count\":-1,\"add\":true},{\"function\":\"minecraft:explosion_decay\"}],\"name\":\"" + nsid + "_wall_fence\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + name + "_wall_hedge.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"functions\":[{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_hedge\",\"properties\":{\"east\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_hedge\",\"properties\":{\"west\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_hedge\",\"properties\":{\"north\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_hedge\",\"properties\":{\"south\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"count\":-1,\"add\":true},{\"function\":\"minecraft:explosion_decay\"}],\"name\":\"" + nsid + "_wall_hedge\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + name + "_wood.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_wood\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + "large_" + name + "_tile_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "large_" + name + "_tile_platform\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + "large_" + name + "_tile_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"entries\":[{\"type\":\"minecraft:item\",\"functions\":[{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + namespace + "large_" + name + "_tile_slab\",\"properties\":{\"type\":\"double\"}}],\"count\":2},{\"function\":\"minecraft:explosion_decay\"}],\"name\":\"" + namespace + "large_" + name + "_tile_slab\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + "large_" + name + "_tile_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "large_" + name + "_tile_stairs\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + "large_" + name + "_tiles.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "large_" + name + "_tiles\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + "potted_" + name + "_sapling.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_sapling\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]},{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"minecraft:flower_pot\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + "small_" + name + "_tile_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "small_" + name + "_tile_platform\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + "small_" + name + "_tile_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"entries\":[{\"type\":\"minecraft:item\",\"functions\":[{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + namespace + "small_" + name + "_tile_slab\",\"properties\":{\"type\":\"double\"}}],\"count\":2},{\"function\":\"minecraft:explosion_decay\"}],\"name\":\"" + namespace + "small_" + name + "_tile_slab\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + "small_" + name + "_tile_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "small_" + name + "_tile_stairs\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + "small_" + name + "_tiles.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "small_" + name + "_tiles\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + "stripped_" + name + "_log.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "stripped_" + name + "_log\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + "stripped_" + name + "_wood.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "stripped_" + name + "_wood\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + "windowed_" + name + "_door.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1.0,\"bonus_rolls\":0.0,\"entries\":[{\"type\":\"minecraft:item\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + namespace + "windowed_" + name + "_door\",\"properties\":{\"half\":\"lower\"}}],\"name\":\"" + namespace + "windowed_" + name + "_door\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(lootpath)\"! No loot table files will be written.") if(Directory.exists(advpath)){ pth = advpath + name + "_boat.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_boat\"]},\"criteria\":{\"in_water\":{\"trigger\":\"minecraft:enter_block\",\"conditions\":{\"block\":\"minecraft:water\"}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_boat\"}}},\"requirements\":[[\"in_water\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + name + "_button.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_button\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_planks\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_button\"}}},\"requirements\":[[\"has_planks\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + name + "_door.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_door\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_planks\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_door\"}}},\"requirements\":[[\"has_planks\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + name + "_fence.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_fence\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_planks\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_fence\"}}},\"requirements\":[[\"has_planks\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + name + "_fence_gate.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_fence_gate\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_planks\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_fence_gate\"}}},\"requirements\":[[\"has_planks\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + name + "_planks.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_planks\"]},\"criteria\":{\"has_log\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"tag\":\"" + nsid + "_logs\"}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_planks\"}}},\"requirements\":[[\"has_log\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + name + "_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_platform\"]},\"criteria\":{\"has_slab\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[\"" + nsid + "_slab\"]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_platform\"}}},\"requirements\":[[\"has_slab\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + name + "_pressure_plate.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_pressure_plate\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_planks\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_pressure_plate\"}}},\"requirements\":[[\"has_planks\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + name + "_sign.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_sign\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_planks\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_sign\"}}},\"requirements\":[[\"has_planks\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + name + "_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_slab\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_planks\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_slab\"}}},\"requirements\":[[\"has_planks\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + name + "_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_stairs\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_planks\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_stairs\"}}},\"requirements\":[[\"has_planks\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + name + "_trapdoor.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_trapdoor\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_planks\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_trapdoor\"}}},\"requirements\":[[\"has_planks\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + name + "_wall_fence.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_wall_fence\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"item\":\"" + nsid + "_planks\"}]}},\"has_stick\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"item\":\"minecraft:stick\"}]}},\"has_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_wall_fence\"}}},\"requirements\":[[\"has_planks\",\"has_recipe\"],[\"has_stick\",\"has_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + name + "_wall_hedge.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_wall_hedge\"]},\"criteria\":{\"has_item\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"item\":\"" + nsid + "_leaves\"}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_wall_hedge\"}}},\"requirements\":[[\"has_item\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + name + "_wood.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_wood\"]},\"criteria\":{\"has_log\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_log\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_wood\"}}},\"requirements\":[[\"has_log\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "large_" + name + "_tile_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tile_platform\"]},\"criteria\":{\"has_slab\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "large_" + name + "_tile_slab\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tile_platform\"}}},\"requirements\":[[\"has_slab\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "large_" + name + "_tile_platform_from_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tile_platform_from_platform\"]},\"criteria\":{\"has_platform\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_platform\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tile_platform_from_platform\"}}},\"requirements\":[[\"has_platform\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "large_" + name + "_tile_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tile_slab\"]},\"criteria\":{\"has_tiles\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "large_" + name + "_tiles\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tile_slab\"}}},\"requirements\":[[\"has_tiles\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "large_" + name + "_tile_slab_from_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tile_slab_from_slab\"]},\"criteria\":{\"has_slab\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_slab\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tile_slab_from_slab\"}}},\"requirements\":[[\"has_slab\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "large_" + name + "_tile_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tile_stairs\"]},\"criteria\":{\"has_tiles\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "large_" + name + "_tiles\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tile_stairs\"}}},\"requirements\":[[\"has_tiles\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "large_" + name + "_tile_stairs_from_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tile_stairs_from_stairs\"]},\"criteria\":{\"has_stairs\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_stairs\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tile_stairs_from_stairs\"}}},\"requirements\":[[\"has_stairs\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "large_" + name + "_tiles.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tiles\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_planks\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tiles\"}}},\"requirements\":[[\"has_planks\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "small_" + name + "_tile_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tile_platform\"]},\"criteria\":{\"has_slab\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "small_" + name + "_tile_slab\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tile_platform\"}}},\"requirements\":[[\"has_slab\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "small_" + name + "_tile_platform_from_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tile_platform_from_platform\"]},\"criteria\":{\"has_platform\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "large_" + name + "_tile_platform\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tile_platform_from_platform\"}}},\"requirements\":[[\"has_platform\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "small_" + name + "_tile_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tile_slab\"]},\"criteria\":{\"has_tiles\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "small_" + name + "_tiles\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tile_slab\"}}},\"requirements\":[[\"has_tiles\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "small_" + name + "_tile_slab_from_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tile_slab_from_slab\"]},\"criteria\":{\"has_slab\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "large_" + name + "_tile_slab\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tile_slab_from_slab\"}}},\"requirements\":[[\"has_slab\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "small_" + name + "_tile_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tile_stairs\"]},\"criteria\":{\"has_tiles\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "small_" + name + "_tiles\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tile_stairs\"}}},\"requirements\":[[\"has_tiles\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "small_" + name + "_tile_stairs_from_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tile_stairs_from_stairs\"]},\"criteria\":{\"has_stairs\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "large_" + name + "_tile_stairs\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tile_stairs_from_stairs\"}}},\"requirements\":[[\"has_stairs\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "small_" + name + "_tiles.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tiles\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_planks\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tiles\"}}},\"requirements\":[[\"has_planks\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "stripped_" + name + "_wood.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "stripped_" + name + "_wood\"]},\"criteria\":{\"has_log\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "stripped_" + name + "_log\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "stripped_" + name + "_wood\"}}},\"requirements\":[[\"has_log\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "windowed_" + name + "_door.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "windowed_" + name + "_door\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"item\":\"" + nsid + "_planks\"}]}},\"has_glass_pane\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"item\":\"minecraft:glass_pane\"}]}},\"has_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "windowed_" + name + "_door\"}}},\"requirements\":[[\"has_planks\",\"has_recipe\"],[\"has_glass_pane\",\"has_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(advpath)\"! No recipe advancement files will be written.") if(Directory.exists(btagpath)){ pth = advpath + name + "_logs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"replace\":false,\"values\":[\"" + nsid + "_log\",\"" + nsid + "_wood\",\"" + namespace + "stripped_" + name + "_log\",\"" + namespace + "stripped_" + name + "_wood\"]}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(btagpath)\"! No recipe advancement files will be written.") if(Directory.exists(itagpath)){ pth = advpath + name + "_logs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"replace\":false,\"values\":[\"" + nsid + "_log\",\"" + nsid + "_wood\",\"" + namespace + "stripped_" + name + "_log\",\"" + namespace + "stripped_" + name + "_wood\"]}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(itagpath)\"! No recipe advancement files will be written.") } static woodVanillaAdditions(namespace, path, warn, verbose){ if(!path.endsWith("/")) path = path + "/" var bspath = path + "assets/" + namespace + "/blockstates/" var bmpath = path + "assets/" + namespace + "/models/block/" var impath = path + "assets/" + namespace + "/models/item/" var lootpath = path + "data/" + namespace + "/loot_tables/blocks/" var recipepath = path + "data/" + namespace + "/recipes/" var advpath = path + "data/" + namespace + "/advancements/recipes/" namespace = namespace + ":" var nsblock = namespace + "block/" + name var nsitem = namespace + "item/" + name var nsid = namespace + name var pth for(name in ["acacia", "birch", "dark_oak", "jungle", "oak", "spruce"]){ if(Directory.exists(bspath)){ pth = bspath + name + "_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + nsblock + "_platform\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + name + "_wall_fence.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = nsblock + "_wall_fence" file.writeBytes("{\"variants\":{\"north=true,east=false,south=false,west=false\":{\"model\":\"" + r + "\"},\"north=false,east=true,south=false,west=false\":{\"model\":\"" + r + "\",\"y\":90},\"north=false,east=false,south=true,west=false\":{\"model\":\"" + r + "\",\"y\":180},\"north=false,east=false,south=false,west=true\":{\"model\":\"" + r + "\",\"y\":270},\"north=true,east=false,south=false,west=true\":{\"model\":\"" + r + "_corner\"},\"north=true,east=true,south=false,west=false\":{\"model\":\"" + r + "_corner\",\"y\":90},\"north=false,east=true,south=true,west=false\":{\"model\":\"" + r + "_corner\",\"y\":180},\"north=false,east=false,south=true,west=true\":{\"model\":\"" + r + "_corner\",\"y\":270},\"north=true,east=false,south=true,west=false\":{\"model\":\"" + r + "_opposite\"},\"north=false,east=true,south=false,west=true\":{\"model\":\"" + r + "_opposite\",\"y\":90},\"north=true,east=true,south=false,west=true\":{\"model\":\"" + r + "_three\"},\"north=true,east=true,south=true,west=false\":{\"model\":\"" + r + "_three\",\"y\":90},\"north=false,east=true,south=true,west=true\":{\"model\":\"" + r + "_three\",\"y\":180},\"north=true,east=false,south=true,west=true\":{\"model\":\"" + r + "_three\",\"y\":270},\"north=true,east=true,south=true,west=true\":{\"model\":\"" + r + "_four\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + name + "_wall_hedge.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = nsblock + "_wall_hedge" file.writeBytes("{\"variants\":{\"north=true,east=false,south=false,west=false\":{\"model\":\"" + r + "\"},\"north=false,east=true,south=false,west=false\":{\"model\":\"" + r + "\",\"y\":90,\"uvlock\":true},\"north=false,east=false,south=true,west=false\":{\"model\":\"" + r + "\",\"y\":180,\"uvlock\":true},\"north=false,east=false,south=false,west=true\":{\"model\":\"" + r + "\",\"y\":270,\"uvlock\":true},\"north=true,east=false,south=false,west=true\":{\"model\":\"" + r + "_corner\"},\"north=true,east=true,south=false,west=false\":{\"model\":\"" + r + "_corner\",\"y\":90,\"uvlock\":true},\"north=false,east=true,south=true,west=false\":{\"model\":\"" + r + "_corner\",\"y\":180,\"uvlock\":true},\"north=false,east=false,south=true,west=true\":{\"model\":\"" + r + "_corner\",\"y\":270,\"uvlock\":true},\"north=true,east=false,south=true,west=false\":{\"model\":\"" + r + "_opposite\"},\"north=false,east=true,south=false,west=true\":{\"model\":\"" + r + "_opposite\",\"y\":90,\"uvlock\":true},\"north=true,east=true,south=false,west=true\":{\"model\":\"" + r + "_three\"},\"north=true,east=true,south=true,west=false\":{\"model\":\"" + r + "_three\",\"y\":90,\"uvlock\":true},\"north=false,east=true,south=true,west=true\":{\"model\":\"" + r + "_three\",\"y\":180,\"uvlock\":true},\"north=true,east=false,south=true,west=true\":{\"model\":\"" + r + "_three\",\"y\":270,\"uvlock\":true},\"north=true,east=true,south=true,west=true\":{\"model\":\"" + r + "_four\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + "large_" + name + "_tile_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + namespace + "block/large_" + name + "_tile_platform" + "\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + "large_" + name + "_tile_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = namespace + "block/large_" + name + "_tile" file.writeBytes("{\"variants\":{\"type=bottom\":{\"model\":\"" + r + "_slab\"},\"type=top\":{\"model\":\"" + r + "_slab_top\"},\"type=double\":{\"model\":\"" + r + "s\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + "large_" + name + "_tile_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = namespace + "block/large_" + name + "_tile_stairs" file.writeBytes("{\"variants\":{\"facing=east,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\"},\"facing=east,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\"},\"facing=east,half=bottom,shape=straight\":{\"model\":\"" + r + "\"},\"facing=east,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=south,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\"},\"facing=south,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\"},\"facing=south,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":180,\"uvlock\":true}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + "large_" + name + "_tiles.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + namespace + "block/large_" + name + "_tiles" + "\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + "small_" + name + "_tile_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + namespace + "block/small_" + name + "_tile_platform" + "\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + "small_" + name + "_tile_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = namespace + "block/small_" + name + "_tile" file.writeBytes("{\"variants\":{\"type=bottom\":{\"model\":\"" + r + "_slab\"},\"type=top\":{\"model\":\"" + r + "_slab_top\"},\"type=double\":{\"model\":\"" + r + "s\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + "small_" + name + "_tile_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = namespace + "block/small_" + name + "_tile_stairs" file.writeBytes("{\"variants\":{\"facing=east,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\"},\"facing=east,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\"},\"facing=east,half=bottom,shape=straight\":{\"model\":\"" + r + "\"},\"facing=east,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=south,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\"},\"facing=south,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\"},\"facing=south,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":180,\"uvlock\":true}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + "small_" + name + "_tiles.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + namespace + "block/small_" + name + "_tiles" + "\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + "windowed_" + name + "_door.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = namespace + "block/windowed_" + name + "_door" file.writeBytes("{\"variants\":{\"facing=east,half=lower,hinge=left,open=false\":{\"model\":\"" + r + "_bottom\"},\"facing=south,half=lower,hinge=left,open=false\":{\"model\":\"" + r + "_bottom\",\"y\":90},\"facing=west,half=lower,hinge=left,open=false\":{\"model\":\"" + r + "_bottom\",\"y\":180},\"facing=north,half=lower,hinge=left,open=false\":{\"model\":\"" + r + "_bottom\",\"y\":270},\"facing=east,half=lower,hinge=right,open=false\":{\"model\":\"" + r + "_bottom_hinge\"},\"facing=south,half=lower,hinge=right,open=false\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":90},\"facing=west,half=lower,hinge=right,open=false\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":180},\"facing=north,half=lower,hinge=right,open=false\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":270},\"facing=east,half=lower,hinge=left,open=true\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":90},\"facing=south,half=lower,hinge=left,open=true\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":180},\"facing=west,half=lower,hinge=left,open=true\":{\"model\":\"" + r + "_bottom_hinge\",\"y\":270},\"facing=north,half=lower,hinge=left,open=true\":{\"model\":\"" + r + "_bottom_hinge\"},\"facing=east,half=lower,hinge=right,open=true\":{\"model\":\"" + r + "_bottom\",\"y\":270},\"facing=south,half=lower,hinge=right,open=true\":{\"model\":\"" + r + "_bottom\"},\"facing=west,half=lower,hinge=right,open=true\":{\"model\":\"" + r + "_bottom\",\"y\":90},\"facing=north,half=lower,hinge=right,open=true\":{\"model\":\"" + r + "_bottom\",\"y\":180},\"facing=east,half=upper,hinge=left,open=false\":{\"model\":\"" + r + "_top\"},\"facing=south,half=upper,hinge=left,open=false\":{\"model\":\"" + r + "_top\",\"y\":90},\"facing=west,half=upper,hinge=left,open=false\":{\"model\":\"" + r + "_top\",\"y\":180},\"facing=north,half=upper,hinge=left,open=false\":{\"model\":\"" + r + "_top\",\"y\":270},\"facing=east,half=upper,hinge=right,open=false\":{\"model\":\"" + r + "_top_hinge\"},\"facing=south,half=upper,hinge=right,open=false\":{\"model\":\"" + r + "_top_hinge\",\"y\":90},\"facing=west,half=upper,hinge=right,open=false\":{\"model\":\"" + r + "_top_hinge\",\"y\":180},\"facing=north,half=upper,hinge=right,open=false\":{\"model\":\"" + r + "_top_hinge\",\"y\":270},\"facing=east,half=upper,hinge=left,open=true\":{\"model\":\"" + r + "_top_hinge\",\"y\":90},\"facing=south,half=upper,hinge=left,open=true\":{\"model\":\"" + r + "_top_hinge\",\"y\":180},\"facing=west,half=upper,hinge=left,open=true\":{\"model\":\"" + r + "_top_hinge\",\"y\":270},\"facing=north,half=upper,hinge=left,open=true\":{\"model\":\"" + r + "_top_hinge\"},\"facing=east,half=upper,hinge=right,open=true\":{\"model\":\"" + r + "_top\",\"y\":270},\"facing=south,half=upper,hinge=right,open=true\":{\"model\":\"" + r + "_top\"},\"facing=west,half=upper,hinge=right,open=true\":{\"model\":\"" + r + "_top\",\"y\":90},\"facing=north,half=upper,hinge=right,open=true\":{\"model\":\"" + r + "_top\",\"y\":180}}}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(bspath)\"! No block state files will be written.") if(Directory.exists(bmpath)){ pth = bmpath + name + "_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"ellas_mod:block/platform\",\"textures\":{\"particle\":\"minecraft:block/" + name + "_planks\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_wall_fence.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"ellas_mod:block/wall_fence\",\"textures\":{\"particle\":\"" + nsblock + "_wall_fence\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_wall_fence_corner.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"ellas_mod:block/wall_fence_corner\",\"textures\":{\"particle\":\"" + nsblock + "_wall_fence\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_wall_fence_four.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"ellas_mod:block/wall_fence_four\",\"textures\":{\"particle\":\"" + nsblock + "_wall_fence\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_wall_fence_opposite.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"ellas_mod:block/wall_fence_opposite\",\"textures\":{\"particle\":\"" + nsblock + "_wall_fence\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_wall_fence_three.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"ellas_mod:block/wall_fence_three\",\"textures\":{\"particle\":\"" + nsblock + "_wall_fence\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_wall_hedge.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"ellas_mod:block/wall_hedge\",\"textures\":{\"particle\":\"minecraft:block/" + name + "_leaves\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_wall_hedge_corner.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"ellas_mod:block/wall_hedge_corner\",\"textures\":{\"particle\":\"minecraft:block/" + name + "_leaves\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_wall_hedge_four.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"ellas_mod:block/wall_hedge_four\",\"textures\":{\"particle\":\"minecraft:block/" + name + "_leaves\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_wall_hedge_opposite.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"ellas_mod:block/wall_hedge_opposite\",\"textures\":{\"particle\":\"minecraft:block/" + name + "_leaves\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_wall_hedge_three.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"ellas_mod:block/wall_hedge_three\",\"textures\":{\"particle\":\"minecraft:block/" + name + "_leaves\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "large_" + name + "_tile_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"ellas_mod:block/platform\",\"textures\":{\"particle\":\"" + namespace + "block/large_" + name + "_tiles\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "large_" + name + "_tile_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/slab\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/large_" + name + "_tiles\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "large_" + name + "_tile_slab_top.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/slab_top\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/large_" + name + "_tiles\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "large_" + name + "_tile_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/large_" + name + "_tiles\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "large_" + name + "_tile_stairs_inner.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/inner_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/large_" + name + "_tiles\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "large_" + name + "_tile_stairs_outer.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/outer_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/large_" + name + "_tiles\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "large_" + name + "_tiles.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/cube_all\",\"textures\":{\"all\":\"" + namespace + "block/large_" + name + "_tiles" + "\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "small_" + name + "_tile_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/cube_all\",\"textures\":{\"particle\":\"" + namespace + "block/small_" + name + "_tiles" + "\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "small_" + name + "_tile_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/slab\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/small_" + name + "_tiles\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "small_" + name + "_tile_slab_top.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/slab_top\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/small_" + name + "_tiles\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "small_" + name + "_tile_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/small_" + name + "_tiles\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "small_" + name + "_tile_stairs_inner.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/inner_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/small_" + name + "_tiles\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "small_" + name + "_tile_stairs_outer.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/outer_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + namespace + "block/small_" + name + "_tiles\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "small_" + name + "_tiles.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/cube_all\",\"textures\":{\"all\":\"" + namespace + "block/small_" + name + "_tiles\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "windowed_" + name + "_door_bottom.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = namespace + "block/windowed_" + name file.writeBytes("{\"parent\":\"minecraft:block/door_bottom\",\"textures\":{\"top\":\"" + r + "_door_top\",\"bottom\":\"" + r + "_door_bottom\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "windowed_" + name + "_door_bottom_hinge.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = namespace + "block/windowed_" + name file.writeBytes("{\"parent\":\"minecraft:block/door_bottom_rh\",\"textures\":{\"top\":\"" + r + "door_top\",\"bottom\":\"" + r + "_door_bottom\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "windowed_" + name + "_door_top.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = namespace + "block/windowed_" + name file.writeBytes("{\"parent\":\"minecraft:block/door_top\",\"textures\":{\"top\":\"" + r + "door_top\",\"bottom\":\"" + r + "_door_bottom\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + "windowed_" + name + "_door_top_hinge.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = namespace + "block/windowed_" + name file.writeBytes("{\"parent\":\"minecraft:block/door_top_rh\",\"textures\":{\"top\":\"" + r + "door_top\",\"bottom\":\"" + r + "_door_bottom\"}}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(bmpath)\"! No block model files will be written.") if(Directory.exists(impath)){ pth = impath + name + "_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + nsblock + "_platform\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + name + "_wall_fence.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + nsblock + "_wall_fence\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + name + "_wall_hedge.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + nsblock + "_wall_hedge\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + "large_" + name + "_tile_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + namespace + "block/large_" + name + "_tile_platform\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + "large_" + name + "_tile_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + namespace + "block/large_" + name + "_tile_slab\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + "large_" + name + "_tile_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + namespace + "block/large_" + name + "_tile_stairs\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + "large_" + name + "_tiles.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + namespace + "block/large_" + name + "_tiles\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + "small_" + name + "_tile_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + namespace + "block/small_" + name + "_tile_platform\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + "small_" + name + "_tile_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + namespace + "block/small_" + name + "_tile_slab\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + "small_" + name + "_tile_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + namespace + "block/small_" + name + "_tile_stairs\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + "small_" + name + "_tiles.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + namespace + "block/small_" + name + "_tiles\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + "windowed_" + name + "_door.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:item/generated\",\"textures\":{\"layer0\":\"" + namespace + "item/windowed_" + name + "_door\"}}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(impath)\"! No item model files will be written.") if(Directory.exists(recipepath)){ pth = recipepath + name + "_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"platform\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"minecraft:" + name + "_slab\"}},\"result\":{\"item\":\"" + nsid + "_platform\",\"count\":12}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + name + "_wall_fence.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"wall_fence\",\"pattern\":[\"#/#\"],\"key\":{\"#\":{\"item\":\"minecraft:" + name + "_planks\"},\"/\":{\"item\":\"minecraft:stick\"}},\"result\":{\"item\":\"" + nsid + "_wall_fence\",\"count\":6}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + name + "_wall_hedge.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"wall_hedge\",\"pattern\":[\"# #\"],\"key\":{\"#\":{\"item\":\"minecraft:" + name + "_leaves\"}},\"result\":{\"item\":\"" + nsid + "_wall_hedge\",\"count\":6}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "large_" + name + "_tiles.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tiles\",\"pattern\":[\"# #\",\" \",\"# #\"],\"key\":{\"#\":{\"item\":\"minecraft:" + name + "_planks\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tiles\",\"count\":4}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "large_" + name + "_tile_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tile_platform\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + namespace + "large_" + name + "_tile_slab\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tile_platform\",\"count\":12}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "large_" + name + "_tile_platform_from_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tile_platform_from_platform\",\"pattern\":[\"# #\",\" \",\"# #\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_platform\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tile_platform\",\"count\":4}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "large_" + name + "_tile_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tile_slab\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + namespace + "large_" + name + "_tiles\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tile_slab\",\"count\":6}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "large_" + name + "_tile_slab_from_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tile_slab_from_slab\",\"pattern\":[\"# #\",\" \",\"# #\"],\"key\":{\"#\":{\"item\":\"minecraft:" + name + "_slab\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tile_slab\",\"count\":4}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "large_" + name + "_tile_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tile_stairs\",\"pattern\":[\"# \",\"## \",\"###\"],\"key\":{\"#\":{\"item\":\"" + namespace + "large_" + name + "_tiles\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tile_stairs\",\"count\":4}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "large_" + name + "_tile_stairs_from_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"large_wooden_tile_stairs_from_stairs\",\"pattern\":[\"# #\",\" \",\"# #\"],\"key\":{\"#\":{\"item\":\"minecraft:" + name + "_stairs\"}},\"result\":{\"item\":\"" + namespace + "large_" + name + "_tile_stairs\",\"count\":4}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "small_" + name + "_tiles.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"small_wooden_tiles\",\"pattern\":[\"# #\",\" \",\"# #\"],\"key\":{\"#\":{\"item\":\"minecraft:" + name + "_planks\"}},\"result\":{\"item\":\"" + namespace + "small_" + name + "_tiles\",\"count\":4}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "small_" + name + "_tile_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"small_wooden_tile_platform\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + namespace + "small_" + name + "_tile_slab\"}},\"result\":{\"item\":\"" + namespace + "small_" + name + "_tile_platform\",\"count\":12}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "small_" + name + "_tile_platform_from_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shapeless\",\"group\":\"small_wooden_tile_platform_from_platform\",\"ingredients\":[{\"item\":\"" + namespace + "large_" + name + "_tile_platform\"}],\"result\":{\"item\":\"" + namespace + "small_" + name + "_tile_platform\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "small_" + name + "_tile_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"small_wooden_tile_slab\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + namespace + "small_" + name + "_tiles\"}},\"result\":{\"item\":\"" + namespace + "small_" + name + "_tile_slab\",\"count\":6}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "small_" + name + "_tile_slab_from_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shapeless\",\"group\":\"small_wooden_tile_slab_from_slab\",\"ingredients\":[{\"item\":\"" + namespace + "large_" + name + "_tile_slab\"}],\"result\":{\"item\":\"" + namespace + "small_" + name + "_tile_slab\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "small_" + name + "_tile_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"group\":\"small_wooden_tile_stairs\",\"pattern\":[\"# \",\"## \",\"###\"],\"key\":{\"#\":{\"item\":\"" + namespace + "small_" + name + "_tiles\"}},\"result\":{\"item\":\"" + namespace + "small_" + name + "_tile_stairs\",\"count\":4}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + "small_" + name + "_tile_stairs_from_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shapeless\",\"group\":\"small_wooden_tile_slab_from_slab\",\"ingredients\":[{\"item\":\"" + namespace + "large_" + name + "_tile_stairs\"}],\"result\":{\"item\":\"" + namespace + "small_" + name + "_tile_stairs\"}}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(recipepath)\"! No recipe files will be written.") if(Directory.exists(lootpath)){ pth = lootpath + name + "_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_platform\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + name + "_wall_fence.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"functions\":[{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_fence\",\"properties\":{\"east\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_fence\",\"properties\":{\"west\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_fence\",\"properties\":{\"north\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_fence\",\"properties\":{\"south\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"count\":-1,\"add\":true},{\"function\":\"minecraft:explosion_decay\"}],\"name\":\"" + nsid + "_wall_fence\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + name + "_wall_hedge.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"functions\":[{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_hedge\",\"properties\":{\"east\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_hedge\",\"properties\":{\"west\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_hedge\",\"properties\":{\"north\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_wall_hedge\",\"properties\":{\"south\":\"true\"}}],\"count\":1,\"add\":true},{\"function\":\"minecraft:set_count\",\"count\":-1,\"add\":true},{\"function\":\"minecraft:explosion_decay\"}],\"name\":\"" + nsid + "_wall_hedge\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + "large_" + name + "_tile_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "large_" + name + "_tile_platform\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + "large_" + name + "_tile_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"entries\":[{\"type\":\"minecraft:item\",\"functions\":[{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + namespace + "large_" + name + "_slab\",\"properties\":{\"type\":\"double\"}}],\"count\":2},{\"function\":\"minecraft:explosion_decay\"}],\"name\":\"" + namespace + "large_" + name + "_slab\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + "large_" + name + "_tile_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "large_" + name + "_tile_stairs\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + "large_" + name + "_tiles.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "large_" + name + "_tile\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + "small_" + name + "_tile_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "small_" + name + "_tile_platform\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + "small_" + name + "_tile_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"entries\":[{\"type\":\"minecraft:item\",\"functions\":[{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + namespace + "small_" + name + "_slab\",\"properties\":{\"type\":\"double\"}}],\"count\":2},{\"function\":\"minecraft:explosion_decay\"}],\"name\":\"" + namespace + "small_" + name + "_slab\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + "small_" + name + "_tile_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "small_" + name + "_tile_stairs\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + "small_" + name + "_tiles.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + "small_" + name + "_tile\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + "windowed_" + name + "_door.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1.0,\"bonus_rolls\":0.0,\"entries\":[{\"type\":\"minecraft:item\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + namespace + "windowed_" + name + "_door\",\"properties\":{\"half\":\"lower\"}}],\"name\":\"" + namespace + "windowed_" + name + "_door\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(lootpath)\"! No loot table files will be written.") if(Directory.exists(advpath)){ pth = advpath + name + "_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_platform\"]},\"criteria\":{\"has_slab\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[\"minecraft:" + name + "_slab\"]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_platform\"}}},\"requirements\":[[\"has_slab\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + name + "_wall_fence.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_wall_fence\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"item\":\"minecraft:" + name + "_planks\"}]}},\"has_stick\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"item\":\"minecraft:stick\"}]}},\"has_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_wall_fence\"}}},\"requirements\":[[\"has_planks\",\"has_recipe\"],[\"has_stick\",\"has_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + name + "_wall_hedge.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_wall_hedge\"]},\"criteria\":{\"has_item\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"item\":\"minecraft:" + name + "_leaves\"}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_wall_hedge\"}}},\"requirements\":[[\"has_item\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "large_" + name + "_tile_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tile_platform\"]},\"criteria\":{\"has_slab\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "large_" + name + "_tile_slab\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tile_platform\"}}},\"requirements\":[[\"has_slab\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "large_" + name + "_tile_platform_from_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tile_platform_from_platform\"]},\"criteria\":{\"has_platform\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_platform\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tile_platform_from_platform\"}}},\"requirements\":[[\"has_platform\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "large_" + name + "_tile_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tile_slab\"]},\"criteria\":{\"has_tiles\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "large_" + name + "_tiles\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tile_slab\"}}},\"requirements\":[[\"has_tiles\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "large_" + name + "_tile_slab_from_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tile_slab_from_slab\"]},\"criteria\":{\"has_slab\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"minecraft:" + name + "_slab\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tile_slab_from_slab\"}}},\"requirements\":[[\"has_slab\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "large_" + name + "_tile_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tile_stairs\"]},\"criteria\":{\"has_tiles\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "large_" + name + "_tiles\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tile_stairs\"}}},\"requirements\":[[\"has_tiles\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "large_" + name + "_tile_stairs_from_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tile_stairs_from_stairs\"]},\"criteria\":{\"has_stairs\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"minecraft:" + name + "_stairs\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tile_stairs_from_stairs\"}}},\"requirements\":[[\"has_stairs\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "large_" + name + "_tiles.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "large_" + name + "_tiles\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"minecraft:" + name + "_planks\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "large_" + name + "_tiles\"}}},\"requirements\":[[\"has_planks\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "small_" + name + "_tile_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tile_platform\"]},\"criteria\":{\"has_slab\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "small_" + name + "_tile_slab\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tile_platform\"}}},\"requirements\":[[\"has_slab\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "small_" + name + "_tile_platform_from_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tile_platform_from_platform\"]},\"criteria\":{\"has_platform\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "large_" + name + "_tile_platform\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tile_platform_from_platform\"}}},\"requirements\":[[\"has_platform\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "small_" + name + "_tile_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tile_slab\"]},\"criteria\":{\"has_tiles\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "small_" + name + "_tiles\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tile_slab\"}}},\"requirements\":[[\"has_tiles\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "small_" + name + "_tile_slab_from_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tile_slab_from_slab\"]},\"criteria\":{\"has_slab\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "large_" + name + "_tile_slab\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tile_slab_from_slab\"}}},\"requirements\":[[\"has_slab\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "small_" + name + "_tile_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tile_stairs\"]},\"criteria\":{\"has_tiles\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "small_" + name + "_tiles\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tile_stairs\"}}},\"requirements\":[[\"has_tiles\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "small_" + name + "_tile_stairs_from_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tile_stairs_from_stairs\"]},\"criteria\":{\"has_stairs\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "large_" + name + "_tile_stairs\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tile_stairs_from_stairs\"}}},\"requirements\":[[\"has_stairs\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "small_" + name + "_tiles.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "small_" + name + "_tiles\"]},\"criteria\":{\"has_tiles\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + namespace + "large_" + name + "_tiles\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "small_" + name + "_tiles\"}}},\"requirements\":[[\"has_tiles\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + "windowed_" + name + "_door.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + namespace + "windowed_" + name + "_door\"]},\"criteria\":{\"has_planks\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"item\":\"" + nsid + "_planks\"}]}},\"has_glass_pane\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"item\":\"minecraft:glass_pane\"}]}},\"has_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + namespace + "windowed_" + name + "_door\"}}},\"requirements\":[[\"has_planks\",\"has_recipe\"],[\"has_glass_pane\",\"has_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(advpath)\"! No recipe advancement files will be written.") } } static woodTags(namespace, names, path, warn, verbose){ if(!path.endsWith("/")) path = path + "/" var btagpath = path + "data/minecraft/tags/blocks/" var itagpath = path + "data/minecraft/tags/items/" var embtagpath = path + "data/ellas_mod/tags/blocks/" var emitagpath = path + "data/ellas_mod/tags/items/" var start = "{\"replace\":false,\"values\":[\"" var end = "\"]}" var ids = [] var pth for(name in names){ if(name.contains(":")){ ids.add(name) } else { ids.add(namespace + ":" + name) } } if(Directory.exists(btagpath)){ pth = btagpath + "fence_gates.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_fence_gate\",\"") + "_fence_gate" + end) file.close() if(verbose) System.print("Writing " + pth) } pth = btagpath + "flower_pots.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var notfirst = false var result = start for(name in names){ if(notfirst) result = result + ",\"" notfirst = true result = result + namespace + ":potted_" + name + "_sapling\"" } var file = File.create(pth) file.writeBytes(result + "]}") file.close() if(verbose) System.print("Writing " + pth) } pth = btagpath + "leaves.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_leaves\",\"") + "_leaves" + end) file.close() if(verbose) System.print("Writing " + pth) } pth = btagpath + "logs_that_burn.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + "#" + ids.join("_logs\",\"#") + "_logs" + end) file.close() if(verbose) System.print("Writing " + pth) } pth = btagpath + "planks.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_planks\",\"") + "_planks" + end) file.close() if(verbose) System.print("Writing " + pth) } pth = btagpath + "saplings.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_sapling\",\"") + "_sapling" + end) file.close() if(verbose) System.print("Writing " + pth) } pth = btagpath + "standing_signs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_sign\",\"") + "_sign" + end) file.close() if(verbose) System.print("Writing " + pth) } pth = btagpath + "wall_signs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_wall_sign\",\"") + "_wall_sign" + end) file.close() if(verbose) System.print("Writing " + pth) } pth = btagpath + "wooden_buttons.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_button\",\"") + "_button" + end) file.close() if(verbose) System.print("Writing " + pth) } pth = btagpath + "wooden_doors.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var result = start + ids.join("_door\",\"") + "_door\"" names.each {|name| result = result + ",\"" + namespace + ":windowed_" + name + "_door\"" } var file = File.create(pth) file.writeBytes(result + "]}") file.close() if(verbose) System.print("Writing " + pth) } pth = btagpath + "wooden_fences.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_fence\",\"") + "_fence" + end) file.close() if(verbose) System.print("Writing " + pth) } pth = btagpath + "wooden_pressure_plates.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_pressure_plate\",\"") + "_pressure_plate" + end) file.close() if(verbose) System.print("Writing " + pth) } pth = btagpath + "wooden_slabs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_slab\",\"") + "_slab" + end) file.close() if(verbose) System.print("Writing " + pth) } pth = btagpath + "wooden_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_stairs\",\"") + "_stairs" + end) file.close() if(verbose) System.print("Writing " + pth) } pth = btagpath + "wooden_trapdoors.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_trapdoor\",\"") + "_trapdoor" + end) file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(btagpath)\"! No recipe advancement files will be written.") if(Directory.exists(itagpath)){ pth = itagpath + "boats.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_boat\",\"") + "_boat" + end) file.close() if(verbose) System.print("Writing " + pth) } /*pth = btagpath + "fence_gates.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_fence_gate\",\"") + "_fence_gate" + end) file.close() if(verbose) System.print("Writing " + pth) }*/ pth = itagpath + "leaves.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_leaves\",\"") + "_leaves" + end) file.close() if(verbose) System.print("Writing " + pth) } pth = itagpath + "logs_that_burn.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_log\",\"") + "_log" + end) file.close() if(verbose) System.print("Writing " + pth) } pth = itagpath + "planks.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_planks\",\"") + "_planks" + end) file.close() if(verbose) System.print("Writing " + pth) } pth = itagpath + "saplings.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_sapling\",\"") + "_sapling" + end) file.close() if(verbose) System.print("Writing " + pth) } pth = itagpath + "signs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_sign\",\"") + "_sign" + end) file.close() if(verbose) System.print("Writing " + pth) } pth = itagpath + "wooden_buttons.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_button\",\"") + "_button" + end) file.close() if(verbose) System.print("Writing " + pth) } pth = itagpath + "wooden_doors.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var result = start + ids.join("_door\",\"") + "_door\"" names.each {|name| result = result + ",\"" + namespace + ":windowed_" + name + "_door\"" } var file = File.create(pth) file.writeBytes(result + "]}") file.close() if(verbose) System.print("Writing " + pth) } pth = itagpath + "wooden_fences.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_fence\",\"") + "_fence" + end) file.close() if(verbose) System.print("Writing " + pth) } pth = itagpath + "wooden_pressure_plates.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_pressure_plate\",\"") + "_pressure_plate" + end) file.close() if(verbose) System.print("Writing " + pth) } pth = itagpath + "wooden_slabs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_slab\",\"") + "_slab" + end) file.close() if(verbose) System.print("Writing " + pth) } pth = itagpath + "wooden_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_stairs\",\"") + "_stairs" + end) file.close() if(verbose) System.print("Writing " + pth) } pth = itagpath + "wooden_trapdoors.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_trapdoor\",\"") + "_trapdoor" + end) file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(itagpath)\"! No recipe advancement files will be written.") if(Directory.exists(embtagpath)){ pth = embtagpath + "wooden_platforms.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_platform\",\"") + "_platform" + end) file.close() if(verbose) System.print("Writing " + pth) } pth = embtagpath + "wall_fences.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_wall_fence\",\"") + "_wall_fence" + end) file.close() if(verbose) System.print("Writing " + pth) } pth = embtagpath + "wall_hedges.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_wall_hedge\",\"") + "_wall_hedge" + end) file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(embtagpath)\"! No recipe advancement files will be written.") if(Directory.exists(emitagpath)){ pth = emitagpath + "wooden_platforms.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_platform\",\"") + "_platform" + end) file.close() if(verbose) System.print("Writing " + pth) } pth = emitagpath + "wall_fences.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_wall_fence\",\"") + "_wall_fence" + end) file.close() if(verbose) System.print("Writing " + pth) } pth = emitagpath + "wall_hedges.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes(start + ids.join("_wall_hedge\",\"") + "_wall_hedge" + end) file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(emitagpath)\"! No recipe advancement files will be written.") } static blockWithBasicVariants(namespace, name, path, warn, verbose){ if(!path.endsWith("/")) path = path + "/" var bspath = path + "assets/" + namespace + "/blockstates/" var bmpath = path + "assets/" + namespace + "/models/block/" var impath = path + "assets/" + namespace + "/models/item/" var lootpath = path + "data/" + namespace + "/loot_tables/blocks/" var recipepath = path + "data/" + namespace + "/recipes/" var advpath = path + "data/" + namespace + "/advancements/recipes/" namespace = namespace + ":" var nsblock = namespace + "block/" + name var nsitem = namespace + "item/" + name var nsid = namespace + name var pth if(Directory.exists(bspath)){ pth = bspath + name + ".json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + nsblock + "\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + name + "_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + nsblock + "_platform\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + name + "_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"variants\":{\"type=bottom\":{\"model\":\"" + nsblock + "_slab\"},\"type=top\":{\"model\":\"" + nsblock + "_slab_top\"},\"type=double\":{\"model\":\"" + nsblock + "\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + name + "_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = nsblock + "_stairs" file.writeBytes("{\"variants\":{\"facing=east,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\"},\"facing=east,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\"},\"facing=east,half=bottom,shape=straight\":{\"model\":\"" + r + "\"},\"facing=east,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=south,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\"},\"facing=south,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\"},\"facing=south,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":180,\"uvlock\":true}}}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(bspath)\"! No block state files will be written.") if(Directory.exists(bmpath)){ pth = bmpath + name + ".json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/cube_all\",\"textures\":{\"all\":\"" + nsblock + "\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"ellas_mod:block/platform\",\"textures\":{\"particle\":\"" + nsblock + "\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/slab\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_slab_top.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/slab_top\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_stairs_inner.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/inner_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_stairs_outer.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/outer_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(bmpath)\"! No block model files will be written.") if(Directory.exists(impath)){ pth = impath + name + ".json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + nsblock + "\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + name + "_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + nsblock + "_platform\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + name + "_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + nsblock + "_slab\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + name + "_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + nsblock + "_stairs\"}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(impath)\"! No item model files will be written.") if(Directory.exists(recipepath)){ pth = recipepath + name + "_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_slab\"}},\"result\":{\"item\":\"" + nsid + "_platform\",\"count\":12}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + name + "_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + nsid + "\"}},\"result\":{\"item\":\"" + nsid + "_slab\",\"count\":6}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + name + "_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"pattern\":[\"# \",\"## \",\"###\"],\"key\":{\"#\":{\"item\":\"" + nsid + "\"}},\"result\":{\"item\":\"" + nsid + "_stairs\",\"count\":4}}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(recipepath)\"! No recipe files will be written.") if(Directory.exists(lootpath)){ pth = lootpath + name + ".json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + name + "_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_platform\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + name + "_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"entries\":[{\"type\":\"minecraft:item\",\"functions\":[{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_slab\",\"properties\":{\"type\":\"double\"}}],\"count\":2},{\"function\":\"minecraft:explosion_decay\"}],\"name\":\"" + nsid + "_slab\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + name + "_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_stairs\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(lootpath)\"! No loot table files will be written.") if(Directory.exists(advpath)){ pth = advpath + name + "_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_platform\"]},\"criteria\":{\"has_slab\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_slab\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_platform\"}}},\"requirements\":[[\"has_slab\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + name + "_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_slab\"]},\"criteria\":{\"has_block\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_slab\"}}},\"requirements\":[[\"has_block\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + name + "_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_stairs\"]},\"criteria\":{\"has_block\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_stairs\"}}},\"requirements\":[[\"has_block\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(advpath)\"! No recipe advancement files will be written.") } static stoneWithBasicVariantsS(namespace, name, path, warn, verbose){ if(!path.endsWith("/")) path = path + "/" var bspath = path + "assets/" + namespace + "/blockstates/" var bmpath = path + "assets/" + namespace + "/models/block/" var impath = path + "assets/" + namespace + "/models/item/" var lootpath = path + "data/" + namespace + "/loot_tables/blocks/" var recipepath = path + "data/" + namespace + "/recipes/" var advpath = path + "data/" + namespace + "/advancements/recipes/" namespace = namespace + ":" var nsblock = namespace + "block/" + name var nsitem = namespace + "item/" + name var nsid = namespace + name var pth if(Directory.exists(bspath)){ pth = bspath + name + "s.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + nsblock + "s\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + name + "_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + nsblock + "_platform\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + name + "_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"variants\":{\"type=bottom\":{\"model\":\"" + nsblock + "_slab\"},\"type=top\":{\"model\":\"" + nsblock + "_slab_top\"},\"type=double\":{\"model\":\"" + nsblock + "s\"}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + name + "_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) var r = nsblock + "_stairs" file.writeBytes("{\"variants\":{\"facing=east,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\"},\"facing=east,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=east,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\"},\"facing=east,half=bottom,shape=straight\":{\"model\":\"" + r + "\"},\"facing=east,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=east,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=east,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=north,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":270,\"uvlock\":true},\"facing=north,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=north,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"uvlock\":true},\"facing=north,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=south,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\"},\"facing=south,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\"},\"facing=south,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=south,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=south,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=south,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"y\":90,\"uvlock\":true},\"facing=west,half=bottom,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"y\":180,\"uvlock\":true},\"facing=west,half=bottom,shape=straight\":{\"model\":\"" + r + "\",\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_left\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=inner_right\":{\"model\":\"" + r + "_inner\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=outer_left\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":180,\"uvlock\":true},\"facing=west,half=top,shape=outer_right\":{\"model\":\"" + r + "_outer\",\"x\":180,\"y\":270,\"uvlock\":true},\"facing=west,half=top,shape=straight\":{\"model\":\"" + r + "\",\"x\":180,\"y\":180,\"uvlock\":true}}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bspath + name + "_wall.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"multipart\":[{\"when\":{\"up\":\"true\"},\"apply\":{\"model\":\"" + nsblock + "_wall_post\"}},{\"when\":{\"north\":\"low\"},\"apply\":{\"model\":\"" + nsblock + "_wall_side\",\"uvlock\":true}},{\"when\":{\"east\":\"low\"},\"apply\":{\"model\":\"" + nsblock + "_wall_side\",\"y\":90,\"uvlock\":true}},{\"when\":{\"south\":\"low\"},\"apply\":{\"model\":\"" + nsblock + "_wall_side\",\"y\":180,\"uvlock\":true}},{\"when\":{\"west\":\"low\"},\"apply\":{\"model\":\"" + nsblock + "_wall_side\",\"y\":270,\"uvlock\":true}},{\"when\":{\"north\":\"tall\"},\"apply\":{\"model\":\"" + nsblock + "_wall_side_tall\",\"uvlock\":true}},{\"when\":{\"east\":\"tall\"},\"apply\":{\"model\":\"" + nsblock + "_wall_side_tall\",\"y\":90,\"uvlock\":true}},{\"when\":{\"south\":\"tall\"},\"apply\":{\"model\":\"" + nsblock + "_wall_side_tall\",\"y\":180,\"uvlock\":true}},{\"when\":{\"west\":\"tall\"},\"apply\":{\"model\":\"" + nsblock + "_wall_side_tall\",\"y\":270,\"uvlock\":true}}]}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(bspath)\"! No block state files will be written.") if(Directory.exists(bmpath)){ pth = bmpath + name + "s.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/cube_all\",\"textures\":{\"all\":\"" + nsblock + "s\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"ellas_mod:block/platform\",\"textures\":{\"particle\":\"" + nsblock + "s\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/slab\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "s\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_slab_top.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/slab_top\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "s\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "s\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_stairs_inner.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/inner_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "s\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_stairs_outer.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/outer_stairs\",\"textures\":{\"bottom\":\"#top\",\"top\":\"" + nsblock + "s\",\"side\":\"#top\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_wall_post.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/template_wall_post\",\"textures\":{\"wall\":\"" + nsblock + "s\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_wall_side.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/template_wall_side\",\"textures\":{\"wall\":\"" + nsblock + "s\"}}") file.close() if(verbose) System.print("Writing " + pth) } pth = bmpath + name + "_wall_side_tall.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/template_wall_side_tall\",\"textures\":{\"wall\":\"" + nsblock + "s\"}}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(bmpath)\"! No block model files will be written.") if(Directory.exists(impath)){ pth = impath + name + "s.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + nsblock + "s\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + name + "_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + nsblock + "_platform\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + name + "_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + nsblock + "_slab\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + name + "_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + nsblock + "_stairs\"}") file.close() if(verbose) System.print("Writing " + pth) } pth = impath + name + "_wall.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/wall_inventory\",\"textures\":{\"wall\":\"" + nsblock + "s\"}}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(impath)\"! No item model files will be written.") if(Directory.exists(recipepath)){ pth = recipepath + name + "_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + nsid + "_slab\"}},\"result\":{\"item\":\"" + nsid + "_platform\",\"count\":12}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + name + "_platform_from_block_stonecutting.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:stonecutting\",\"ingredient\":{\"item\":\"" + nsid + "s\"},\"result\":\"" + nsid + "_platform\",\"count\":8}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + name + "_platform_from_slab_stonecutting.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:stonecutting\",\"ingredient\":{\"item\":\"" + nsid + "_slab\"},\"result\":\"" + nsid + "_platform\",\"count\":4}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + name + "_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"pattern\":[\"###\"],\"key\":{\"#\":{\"item\":\"" + nsid + "s\"}},\"result\":{\"item\":\"" + nsid + "_slab\",\"count\":6}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + name + "_slab_stonecutting.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:stonecutting\",\"ingredient\":{\"item\":\"" + nsid + "s\"},\"result\":\"" + nsid + "_slab\",\"count\":2}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + name + "_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"pattern\":[\"# \",\"## \",\"###\"],\"key\":{\"#\":{\"item\":\"" + nsid + "s\"}},\"result\":{\"item\":\"" + nsid + "_stairs\",\"count\":4}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + name + "_stairs_stonecutting.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:stonecutting\",\"ingredient\":{\"item\":\"" + nsid + "s\"},\"result\":\"" + nsid + "_stairs\",\"count\":1}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + name + "_wall.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:crafting_shaped\",\"pattern\":[\"###\",\"###\"],\"key\":{\"#\":{\"item\":\"" + nsid + "s\"}},\"result\":{\"item\":\"" + nsid + "_wall\",\"count\":6}}") file.close() if(verbose) System.print("Writing " + pth) } pth = recipepath + name + "_wall_stonecutting.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:stonecutting\",\"ingredient\":{\"item\":\"" + nsid + "s\"},\"result\":\"" + nsid + "_wall\",\"count\":1}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(recipepath)\"! No recipe files will be written.") if(Directory.exists(lootpath)){ pth = lootpath + name + "s.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "s\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + name + "_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_platform\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + name + "_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"entries\":[{\"type\":\"minecraft:item\",\"functions\":[{\"function\":\"minecraft:set_count\",\"conditions\":[{\"condition\":\"minecraft:block_state_property\",\"block\":\"" + nsid + "_slab\",\"properties\":{\"type\":\"double\"}}],\"count\":2},{\"function\":\"minecraft:explosion_decay\"}],\"name\":\"" + nsid + "_slab\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + name + "_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_stairs\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } pth = lootpath + name + "_wall.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + nsid + "_wall\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(lootpath)\"! No loot table files will be written.") if(Directory.exists(advpath)){ pth = advpath + name + "_platform.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_platform\"]},\"criteria\":{\"has_slab\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_slab\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_platform\"}}},\"requirements\":[[\"has_slab\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + name + "_platform_from_block_stonecutting.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_platform_from_block_stonecutting\"]},\"criteria\":{\"has_block\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "s\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_platform_from_block_stonecutting\"}}},\"requirements\":[[\"has_block\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + name + "_platform_from_slab_stonecutting.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_platform_from_slab_stonecutting\"]},\"criteria\":{\"has_slab\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "_slab\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_platform_from_slab_stonecutting\"}}},\"requirements\":[[\"has_slab\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + name + "_slab.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_slab\"]},\"criteria\":{\"has_block\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "s\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_slab\"}}},\"requirements\":[[\"has_block\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + name + "_slab_stonecutting.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_slab_stonecutting\"]},\"criteria\":{\"has_block\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "s\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_slab_stonecutting\"}}},\"requirements\":[[\"has_block\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + name + "_stairs.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_stairs\"]},\"criteria\":{\"has_block\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "s\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_stairs\"}}},\"requirements\":[[\"has_block\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + name + "_stairs_stonecutting.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_stairs_stonecutting\"]},\"criteria\":{\"has_block\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "s\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_stairs_stonecutting\"}}},\"requirements\":[[\"has_block\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + name + "_wall.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_wall\"]},\"criteria\":{\"has_block\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "s\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_wall\"}}},\"requirements\":[[\"has_block\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } pth = advpath + name + "_wall_stonecutting.json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:recipes/root\",\"rewards\":{\"recipes\":[\"" + nsid + "_wall_stonecutting\"]},\"criteria\":{\"has_block\":{\"trigger\":\"minecraft:inventory_changed\",\"conditions\":{\"items\":[{\"items\":[\"" + nsid + "s\"]}]}},\"has_the_recipe\":{\"trigger\":\"minecraft:recipe_unlocked\",\"conditions\":{\"recipe\":\"" + nsid + "_wall_stonecutting\"}}},\"requirements\":[[\"has_block\",\"has_the_recipe\"]]}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(advpath)\"! No recipe advancement files will be written.") } static singleBlock(namespace, name, path, warn, verbose){ if(!path.endsWith("/")) path = path + "/" var bspath = path + "assets/" + namespace + "/blockstates/" var bmpath = path + "assets/" + namespace + "/models/block/" var impath = path + "assets/" + namespace + "/models/item/" var lootpath = path + "data/" + namespace + "/loot_tables/blocks/" namespace = namespace + ":" var nsblock = namespace + "block/" + name var pth if(Directory.exists(bspath)){ pth = bspath + name + ".json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"variants\":{\"\":{\"model\":\"" + nsblock + "\"}}}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(bspath)\"! No block state file will be written.") if(Directory.exists(bmpath)){ pth = bmpath + name + ".json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"minecraft:block/cube_all\",\"textures\":{\"all\":\"" + nsblock + "\"}}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(bmpath)\"! No block model file will be written.") if(Directory.exists(impath)){ pth = impath + name + ".json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"parent\":\"" + nsblock + "\"}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(impath)\"! No item model file will be written.") if(Directory.exists(lootpath)){ pth = lootpath + name + ".json" if(File.exists(pth)){ if(warn) System.print(pth + " exists, skipping") } else { var file = File.create(pth) file.writeBytes("{\"type\":\"minecraft:block\",\"pools\":[{\"rolls\":1,\"bonus_rolls\":0,\"entries\":[{\"type\":\"minecraft:item\",\"name\":\"" + namespace + name + "\"}],\"conditions\":[{\"condition\":\"minecraft:survives_explosion\"}]}]}") file.close() if(verbose) System.print("Writing " + pth) } } else if(warn) System.print("Missing \"%(lootpath)\"! No loot table file will be written.") } } if(Process.arguments.count == 0){ //System.print("Doing nothing.") } else { var shift = 0 var verbose = false var warn = false for(arg in Process.arguments){ if(arg == "-v" || arg == "--verbose"){ shift = shift + 1 verbose = true } else if(arg == "-w" || arg == "--warn"){ shift = shift + 1 warn = true } else if(arg.startsWith("-")){ Fiber.abort("Unknown option \"%(arg)\"") } else break } if(Process.arguments[shift] == "help"){ System.print("Usage: (script call) [options] namespace \nExample: wren_cli generate.wren wood /path/to/mod_files_base/ namespace firstwood secondwood\n\nOptions:\n -v --verbose Print the written files\n -w --warn Print warnings when files or directories don't exist\n\nTypes:\n- wood The vanilla wood family as well as platform and tile variants\n- woodvanilla Hardcoded to generate extensions for the vanilla wood types\n- variants Block, stairs, slab and platform\n- stone Like variants but with wall and stonecutting as well as adding an s to the full block\n- single A single block") } else if(Process.arguments[shift] == "wood"){ if(Process.arguments.count == shift + 1){ System.print("No base path specified.") } else if(Process.arguments.count == shift + 2){ System.print("No namespace specified.") } else if(Process.arguments.count == shift + 3){ System.print("No wood types specified.") } else { for(type in Process.arguments[shift + 3..-1]){ System.print("Generating wood type " + type) Generator.woodType(Process.arguments[shift + 2], type, Process.arguments[shift + 1], warn, verbose) } System.print("Now make sure there are textures, translations and tags (see generation type \"woodtags\") for the new wood types.") } } else if(Process.arguments[shift] == "woodvanilla"){ if(Process.arguments.count == shift + 1){ System.print("No base path specified.") } else if(Process.arguments.count == shift + 2){ System.print("No namespace specified.") } else { System.print("Generating vanilla wood additions") Generator.woodVanillaAdditions(Process.arguments[shift + 2], Process.arguments[shift + 1], warn, verbose) } } else if(Process.arguments[shift] == "woodtags"){ if(Process.arguments.count == shift + 1){ System.print("No base path specified.") } else if(Process.arguments.count == shift + 2){ System.print("No namespace specified.") } else if(Process.arguments.count == shift + 3){ System.print("No wood types specified.") } else { //System.print("Generating wood type " + type) Generator.woodTags(Process.arguments[shift + 2], Process.arguments[shift + 3..-1], Process.arguments[shift + 1], warn, verbose) } } else if(Process.arguments[shift] == "variants"){ if(Process.arguments.count == shift + 1){ System.print("No base path specified.") } else if(Process.arguments.count == shift + 2){ System.print("No namespace specified.") } else if(Process.arguments.count == shift + 3){ System.print("No block types specified.") } else { for(type in Process.arguments[shift + 3..-1]){ System.print("Generating block type " + type) Generator.blockWithBasicVariants(Process.arguments[shift + 2], type, Process.arguments[shift + 1], warn, verbose) } System.print("Now make sure there are textures, translations and perhaps tags for the new block types.") } } else if(Process.arguments[shift] == "stone"){ if(Process.arguments.count == shift + 1){ System.print("No base path specified.") } else if(Process.arguments.count == shift + 2){ System.print("No namespace specified.") } else if(Process.arguments.count == shift + 3){ System.print("No block types specified.") } else { for(type in Process.arguments[shift + 3..-1]){ System.print("Generating block type " + type) Generator.stoneWithBasicVariantsS(Process.arguments[shift + 2], type, Process.arguments[shift + 1], warn, verbose) } System.print("Now make sure there are textures, translations and perhaps tags for the new block types.") } } else if(Process.arguments[shift] == "single"){ if(Process.arguments.count == shift + 1){ System.print("No base path specified.") } else if(Process.arguments.count == shift + 2){ System.print("No namespace specified.") } else if(Process.arguments.count == shift + 3){ System.print("No block specified.") } else { for(type in Process.arguments[shift + 3..-1]){ System.print("Generating block " + type) Generator.singleBlock(Process.arguments[shift + 2], type, Process.arguments[shift + 1], warn, verbose) } System.print("Now make sure there is a texture and a translation for the new block(s).") } } else { System.print("Unknown action \"%(Process.arguments[shift])\"") } }