mirror of
https://github.com/minetest-mods/ropes.git
synced 2024-11-24 16:33:48 +01:00
add upgrader for old vine mod's nodes
This commit is contained in:
parent
289a3c4c2d
commit
c4d1bed474
25
init.lua
25
init.lua
@ -20,4 +20,29 @@ dofile( minetest.get_modpath( ropes.name ) .. "/crafts.lua" )
|
||||
dofile( minetest.get_modpath( ropes.name ) .. "/ropeboxes.lua" )
|
||||
dofile( minetest.get_modpath( ropes.name ) .. "/ladder.lua" )
|
||||
|
||||
local upgrade_counter = 1
|
||||
-- For players who used to use the combined vine/rope mod fork I split this out of
|
||||
local swapper = function(old_node, new_node)
|
||||
minetest.register_lbm({
|
||||
name = "ropes:vines_to_ropes_upgrade_" .. tostring(upgrade_counter),
|
||||
nodenames = {old_node},
|
||||
action = function(pos, node)
|
||||
minetest.swap_node(pos, {name=new_node, param2=node.param2})
|
||||
end
|
||||
})
|
||||
upgrade_counter = upgrade_counter + 1
|
||||
end
|
||||
for i=1,5 do
|
||||
swapper(string.format("vines:%irope_block", i), string.format("ropes:%irope_block", i))
|
||||
end
|
||||
swapper("vines:rope", "ropes:rope")
|
||||
swapper("vines:rope_bottom", "ropes:rope_bottom")
|
||||
swapper("vines:rope_end", "ropes:rope_bottom")
|
||||
swapper("vines:rope_top", "ropes:rope_top")
|
||||
swapper("vines:ropeladder_top", "ropes:ropeladder_top")
|
||||
swapper("vines:ropeladder", "ropes:ropeladder")
|
||||
swapper("vines:ropeladder_bottom", "ropes:ropeladder_bottom")
|
||||
swapper("vines:ropeladder_falling", "ropes:ropeladder_falling")
|
||||
|
||||
|
||||
print("[Ropes] Loaded!")
|
||||
|
Loading…
Reference in New Issue
Block a user