From ba6a90f8e0c8acdb362a02d77cb03e306e15fdef Mon Sep 17 00:00:00 2001 From: Tomas Date: Sat, 27 Sep 2025 05:50:43 +0200 Subject: [PATCH] Added tools --- tools/metblock.py | 94 ++++++++++++++++++++ tools/tools.py | 212 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 306 insertions(+) create mode 100644 tools/metblock.py create mode 100644 tools/tools.py diff --git a/tools/metblock.py b/tools/metblock.py new file mode 100644 index 0000000..7257a2a --- /dev/null +++ b/tools/metblock.py @@ -0,0 +1,94 @@ +nuggets = [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", +] + +ingots = [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", +] + +blocks = [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", +] + + +with open("metal-ban.zs", "w") as file: + for nug, ing, blk in zip(nuggets, ingots, blocks): + file.write(f"recipes.removeShaped({ing}, [[{nug},{nug},{nug}],[{nug},{nug},{nug}],[{nug},{nug},{nug}]]);\n") + file.write(f"recipes.removeShaped({blk}, [[{ing},{ing},{ing}],[{ing},{ing},{ing}],[{ing},{ing},{ing}]]);\n") + file.write(f"recipes.removeShapeless({nug}*9, [{ing}]);\n") + file.write(f"recipes.removeShapeless({ing}*9, [{blk}]);\n") \ No newline at end of file diff --git a/tools/tools.py b/tools/tools.py new file mode 100644 index 0000000..366ac1c --- /dev/null +++ b/tools/tools.py @@ -0,0 +1,212 @@ +vanilla_materials = [ + "iron", + "golden", + # "diamond", # It's a gem +] + +vanilla_tools = [ + "shovel", + "pickaxe", + "axe", + "hoe", + "sword", +] + +vanilla_armor = [ + "helmet", + "chestplate", + "leggings", + "boots", +] + +thermal_materials = [ + "lead", + "electrum", + "steel", + "platinum", + "nickel", + "aluminum", + "silver", + "tin", + "copper", + "invar", + "bronze", + "constantan", +] + +thermal_tools = [ + "shovel", + "pickaxe", + "axe", + "hoe", + "fishing_rod", + "shears", + "sickle", + "hammer", + "excavator", + "sword", + "bow", + # "shield", +] + +thermal_armor = [ + "helmet", + "plate", + "legs", + "boots", +] + +vanilla_thermal_materials = [ + "iron", + "gold", + # "diamond", # It's a gem +] + +vanilla_thermal_tools = [ + "bow", + # "shield", + "fishing_rod", + "sickle", + "hammer", + "excavator", +] + +ice_and_fire_materials = [ + "dragonsteel_fire", + "dragonsteel_ice", +] + + +parts = { + "pickaxe": lambda material: f".withTag({{Material: \"{material}\"}})", + "axe": lambda material: f".withTag({{Material: \"{material}\"}})", + "shovel": lambda material: f".withTag({{Material: \"{material}\"}})", + "hoe": lambda material: f".withTag({{Material: \"{material}\"}})", + "scythe": lambda material: f".withTag({{Material: \"{material}\"}})", + "knife": lambda material: f".withTag({{Material: \"{material}\"}})", + "sword": lambda material: f".withTag({{Material: \"{material}\"}})", + "hammer": lambda material: f".withTag({{Material: \"{material}\"}})", + "excavator": lambda material: f".withTag({{Material: \"{material}\"}})", + + "helmet": lambda material: f".withTag({{Material: \"{material}\"}})", + "chestplate": lambda material: f".withTag({{Material: \"{material}\"}})", + "leggings": lambda material: f".withTag({{Material: \"{material}\"}})", + "boots": lambda material: f".withTag({{Material: \"{material}\"}})", + + "rod": lambda material: f".withTag({{Material: \"{material}\"}})", + "stick": lambda material: "", + "string": lambda material: "", +} + +def ingot(material): + return f"" + +def common_recepie(part, material): + return f"[[{parts[part](material)}],[{parts['stick'](material)}],[{parts['stick'](material)}]]" + + +recepies = { + "shovel": lambda m: common_recepie("shovel", m), + "pickaxe": lambda m: common_recepie("pickaxe", m), + "axe": lambda m: common_recepie("axe", m), + "hoe": lambda m: common_recepie("hoe", m), + "fishing_rod": lambda m: f"[[null, null, {parts['rod'](m)}],[null, {parts['rod'](m)},{parts['string'](m)}], [{parts['rod'](m)}, null, {parts['string'](m)}]]", + "shears": lambda m: f"[[null, {parts['knife'](m)}], [{parts['knife'](m)}, null]]", + "sickle": lambda m: f"[[{parts['scythe'](m)}],[{parts['stick'](m)}]]", + "hammer": lambda m: common_recepie("hammer", m), + "excavator": lambda m: common_recepie("excavator", m), + "sword": lambda m: f"[[{parts['sword'](m)}],[{parts['stick'](m)}]]", + "bow": lambda m: f"[[null,{parts['rod'](m)},{parts['string'](m)}], [{parts['stick'](m)},null,{parts['string'](m)}], [null,{parts['rod'](m)},{parts['string'](m)}]]", + + "helmet": lambda m: f"[[{parts['helmet'](m)}]]", + "chestplate": lambda m: f"[[{parts['chestplate'](m)}]]", + "leggings": lambda m: f"[[{parts['leggings'](m)}]]", + "boots": lambda m: f"[[{parts['boots'](m)}]]", + + # Copies of "chestplate" and "leggings" + "plate": lambda m: f"[[{parts['chestplate'](m)}]]", + "legs": lambda m: f"[[{parts['leggings'](m)}]]", +} + + +with open("tools.zs", "w") as file: + def put(line=None): + if line is None: + line = "" + file.write(str(line)+"\n") + + put("// Vanilla Tools") + put("\t// Shears") + put(f"\trecipes.remove();") + put(f"\trecipes.addShapedMirrored(, {recepies['shears']('iron')});") + put() + for tool in vanilla_tools: + put(f"\t// {tool.capitalize()}") + for material in vanilla_materials: + put(f"\trecipes.remove();") + put(f"\trecipes.addShapedMirrored(, {recepies[tool](material)});") + put() + put() + put() + + put("// Thermal Tools") + for tool in thermal_tools: + put(f"\t// {tool.capitalize()}") + for material in thermal_materials: + put(f"\trecipes.remove();") + put(f"\trecipes.addShapedMirrored(, {recepies[tool](material)});") + put() + put() + put() + + put("// Thermal Tools (Vanilla)") + for tool in vanilla_thermal_tools: + put(f"\t// {tool.capitalize()}") + for material in vanilla_thermal_materials: + put(f"\trecipes.remove();") + put(f"\trecipes.addShapedMirrored(, {recepies[tool](material)});") + put() + put() + put() + + put("// Ice and Fire Tools") + for tool in vanilla_tools: + put(f"\t// {tool.capitalize()}") + for material in ice_and_fire_materials: + put(f"\trecipes.remove();") + put(f"\trecipes.addShapedMirrored(, {recepies[tool](material)});") + put() + put() + put() + + put("// Vanilla Armor") + for armor in vanilla_armor: + put(f"\t// {armor.capitalize()}") + for material in vanilla_materials: + put(f"\trecipes.remove();") + put(f"\trecipes.addShaped(, {recepies[armor](material)});") + put() + put() + put() + + put("// Thermal Armor") + for armor in thermal_armor: + put(f"\t// {armor.capitalize()}") + for material in thermal_materials: + put(f"\trecipes.remove();") + put(f"\trecipes.addShaped(, {recepies[armor](material)});") + put() + put() + put() + + # NOTE: No armor core casts ! + # + # put("// Ice and Fire Armor") + # for tool in vanilla_armor: + # put(f"\t// {tool.capitalize()}") + # for material in ice_and_fire_materials: + # put(f"\trecipes.remove();") + # put(f"\trecipes.addShapedMirrored(, {recepies[tool](material)});") + # put() + # put() + # put() \ No newline at end of file