From e38f215faa95ad7fc2fb8c473f830aa689c468d2 Mon Sep 17 00:00:00 2001 From: Maverick2797 Date: Wed, 24 Feb 2021 20:16:55 +0800 Subject: Added alternative recipes, falling back on the default: items as they seem to be in the rest of the mod. May need rebalancing though. --- advtrains_interlocking/tcb_ts_ui.lua | 30 +++++++++++++++++++++++++++++- advtrains_signals_ks/init.lua | 9 ++++++++- advtrains_train_track/init.lua | 14 +++++++++++++- 3 files changed, 50 insertions(+), 3 deletions(-) mode change 100644 => 100755 advtrains_interlocking/tcb_ts_ui.lua mode change 100644 => 100755 advtrains_signals_ks/init.lua mode change 100644 => 100755 advtrains_train_track/init.lua diff --git a/advtrains_interlocking/tcb_ts_ui.lua b/advtrains_interlocking/tcb_ts_ui.lua old mode 100644 new mode 100755 index 38d4453..34fbf7f --- a/advtrains_interlocking/tcb_ts_ui.lua +++ b/advtrains_interlocking/tcb_ts_ui.lua @@ -120,13 +120,41 @@ minetest.register_node("advtrains_interlocking:tcb_node", { -- Crafting + +-- set some fallbacks +local tcb_core = "default:mese_crystal" +local tcb_secondary = "default:mese_crystal_fragment" + +--alternative recipe items +--core +if minetest.get_modpath("basic_materials") then + tcb_core = "basic_materials:ic" +elseif minetest.get_modpath("technic") then + tcb_core = "technic:control_logic_unit" +end +--print("TCB Core: "..tcb_core) +--secondary +if minetest.get_modpath("mesecons") then + tcb_secondary = 'mesecons:wire_00000000_off' +end +--print("TCB Secondary: "..tcb_secondary) + minetest.register_craft({ output = 'advtrains_interlocking:tcb_node 4', recipe = { - {'mesecons:wire_00000000_off', 'basic_materials:ic', 'mesecons:wire_00000000_off'}, + {tcb_secondary,tcb_core,tcb_secondary}, + {'advtrains:dtrack_placer','','advtrains:dtrack_placer'} }, + --actually use track in the tcb recipe + replacements = { + {"advtrains:dtrack_placer","advtrains:dtrack_placer"}, + {"advtrains:dtrack_placer","advtrains:dtrack_placer"}, + } }) +--nil the temp crafting variables +tcb_core= nil +tcb_secondary = nil minetest.register_on_punchnode(function(pos, node, player, pointed_thing) local pname = player:get_player_name() diff --git a/advtrains_signals_ks/init.lua b/advtrains_signals_ks/init.lua old mode 100644 new mode 100755 index 1c60a0e..aa1b1cb --- a/advtrains_signals_ks/init.lua +++ b/advtrains_signals_ks/init.lua @@ -270,11 +270,18 @@ minetest.register_craft({ }, }) +local sign_material = "default:sign_wall_steel" --fallback +if minetest.get_modpath("basic_materials") then + sign_material = "basic_materials:plastic_sheet" +end +--print("Sign Material: "..sign_material) + minetest.register_craft({ output = "advtrains_signals_ks:sign_8_0 2", recipe = { - {'basic_materials:plastic_sheet', 'dye:black'}, + {sign_material, 'dye:black'}, {'default:stick', ''}, {'default:stick', ''}, }, }) +sign_material = nil diff --git a/advtrains_train_track/init.lua b/advtrains_train_track/init.lua old mode 100644 new mode 100755 index 78d1392..744d86b --- a/advtrains_train_track/init.lua +++ b/advtrains_train_track/init.lua @@ -298,15 +298,27 @@ advtrains.register_tracks("default", { end }, advtrains.trackpresets.t_30deg_straightonly) +-- mod-dependent crafts +local loader_core = "default:mese_crystal" --fallback +if minetest.get_modpath("basic_materials") then + loader_core = "basic_materials:ic" +elseif minetest.get_modpath("technic") then + loader_core = "technic:control_logic_unit" +end +--print("Loader Core: "..loader_core) + minetest.register_craft({ type="shapeless", output = 'advtrains:dtrack_load_placer', recipe = { "advtrains:dtrack_placer", - "basic_materials:ic", + loader_core, "default:chest" }, }) +loader_core = nil --nil the crafting variable + +--craft between load/unload tracks minetest.register_craft({ type="shapeless", output = 'advtrains:dtrack_unload_placer', -- cgit v1.2.3