aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--]advtrains_interlocking/tcb_ts_ui.lua30
-rwxr-xr-x[-rw-r--r--]advtrains_signals_ks/init.lua9
-rwxr-xr-x[-rw-r--r--]advtrains_train_track/init.lua14
3 files changed, 50 insertions, 3 deletions
diff --git a/advtrains_interlocking/tcb_ts_ui.lua b/advtrains_interlocking/tcb_ts_ui.lua
index 38d4453..34fbf7f 100644..100755
--- 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
index 1c60a0e..aa1b1cb 100644..100755
--- 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
index 78d1392..744d86b 100644..100755
--- 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',