aboutsummaryrefslogtreecommitdiff
path: root/advtrains_train_track/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'advtrains_train_track/init.lua')
-rw-r--r--advtrains_train_track/init.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/advtrains_train_track/init.lua b/advtrains_train_track/init.lua
index d6b8e52..d85f8a1 100644
--- a/advtrains_train_track/init.lua
+++ b/advtrains_train_track/init.lua
@@ -62,6 +62,25 @@ minetest.register_craft({
{'', '', 'advtrains:dtrack_placer'}
}
})
+-- Deprecate any rails using the old name scheme
+minetest.register_lbm({
+ label = "Upgrade legacy 4590 rails",
+ name = "advtrains_train_track:replace_legacy_4590",
+ nodenames = {"advtrains:dtrack_xing4590_st"},
+ run_at_every_load = true,
+ action = function(pos, node)
+ minetest.log("actionPos!: " .. pos.x .. "," .. pos.y .. "," .. pos.z)
+ minetest.log("node!: " .. node.name .. "," .. node.param1 .. "," .. node.param2)
+ advtrains.ndb.swap_node(pos,
+ {
+ name="advtrains:dtrack_xing90plusx_45l",
+ param1=node.param1,
+ param2=node.param2,
+ })
+ end
+})
+-- This will replace any items left in the inventory
+minetest.register_alias("advtrains:dtrack_xing4590_placer", "advtrains:dtrack_xing90plusx_placer")
-- Diagonal
-- This set of rail crossings is named based on the angle of each intersecting