From 27c134f41e3bc5d0fa615e4f7ffdafe5ffd41abd Mon Sep 17 00:00:00 2001 From: SX Date: Tue, 28 Apr 2020 09:56:28 +0300 Subject: [PATCH] Replace digiline wires with digimese if digistuff is enabled --- technic/machines/HV/cables.lua | 55 ++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/technic/machines/HV/cables.lua b/technic/machines/HV/cables.lua index 00397e5..eb29c91 100644 --- a/technic/machines/HV/cables.lua +++ b/technic/machines/HV/cables.lua @@ -1,5 +1,3 @@ -local S = technic.getter - minetest.register_craft({ output = 'technic:hv_cable 3', recipe = { @@ -11,26 +9,39 @@ minetest.register_craft({ technic.register_cable("HV", 3/16) -minetest.register_craft({ - output = 'technic:hv_digi_cable 1', - recipe = { - {'digilines:wire_std_00000000', 'digilines:wire_std_00000000', 'digilines:wire_std_00000000'}, - {'digilines:wire_std_00000000', 'technic:hv_cable', 'digilines:wire_std_00000000'}, - {'digilines:wire_std_00000000', 'digilines:wire_std_00000000', 'digilines:wire_std_00000000'}, - } -}) +if minetest.get_modpath("digilines") then -technic.register_cable("HV", 3/16, S("HV Cable (digiline)"), "_digi", { - digiline = { - wire = { - rules = { - {x = 1, y = 0, z = 0}, - {x =-1, y = 0, z = 0}, - {x = 0, y = 1, z = 0}, - {x = 0, y =-1, z = 0}, - {x = 0, y = 0, z = 1}, - {x = 0, y = 0, z =-1} + local S = technic.getter + + if minetest.get_modpath("digistuff") then + minetest.register_craft({ + output = 'technic:hv_digi_cable 1', + type = "shapeless", + recipe = {'digistuff:digimese', 'technic:hv_cable'} + }) + else + minetest.register_craft({ + output = 'technic:hv_digi_cable 1', + recipe = { + {'digilines:wire_std_00000000', 'digilines:wire_std_00000000', 'digilines:wire_std_00000000'}, + {'digilines:wire_std_00000000', 'technic:hv_cable', 'digilines:wire_std_00000000'}, + {'digilines:wire_std_00000000', 'digilines:wire_std_00000000', 'digilines:wire_std_00000000'}, + } + }) + end + + technic.register_cable("HV", 3/16, S("HV Cable (digiline)"), "_digi", { + digiline = { + wire = { + rules = { + {x = 1, y = 0, z = 0}, + {x =-1, y = 0, z = 0}, + {x = 0, y = 1, z = 0}, + {x = 0, y =-1, z = 0}, + {x = 0, y = 0, z = 1}, + {x = 0, y = 0, z =-1} + } } } - } -}) + }) +end