diff options
author | Gabriel PĂ©rez-Cerezo <gabriel@gpcf.eu> | 2017-08-20 14:32:38 +0200 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2017-10-25 09:52:10 +0200 |
commit | f228e2d30e0d712c6490fb84d4edfadeba8c4cd7 (patch) | |
tree | 9f7eaf8be4e54e162586b44547d9f7af6ded4036 /advtrains/trackplacer.lua | |
parent | 291da56aa22608863252f419bbd8f226f0913c76 (diff) | |
download | advtrains-f228e2d30e0d712c6490fb84d4edfadeba8c4cd7.tar.gz advtrains-f228e2d30e0d712c6490fb84d4edfadeba8c4cd7.tar.bz2 advtrains-f228e2d30e0d712c6490fb84d4edfadeba8c4cd7.zip |
Moved default train track to separate mod, for integration with advcarts.
Diffstat (limited to 'advtrains/trackplacer.lua')
-rw-r--r-- | advtrains/trackplacer.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/advtrains/trackplacer.lua b/advtrains/trackplacer.lua index e94b4ff..124e958 100644 --- a/advtrains/trackplacer.lua +++ b/advtrains/trackplacer.lua @@ -139,6 +139,7 @@ function tp.placetrack(pos, nnpref, placer, itemstack, pointed_thing) p_rails[#p_rails+1]=i end end + if #p_rails==0 then minetest.set_node(pos, {name=nnpref.."_"..tr.default}) if minetest.registered_nodes[nnpref.."_"..tr.default] and minetest.registered_nodes[nnpref.."_"..tr.default].after_place_node then @@ -181,7 +182,7 @@ end function tp.register_track_placer(nnprefix, imgprefix, dispname) - minetest.register_craftitem(nnprefix.."_placer",{ + minetest.register_craftitem(":"..nnprefix.."_placer",{ description = dispname, inventory_image = imgprefix.."_placer.png", wield_image = imgprefix.."_placer.png", @@ -200,7 +201,8 @@ function tp.register_track_placer(nnprefix, imgprefix, dispname) return itemstack, false end if minetest.registered_nodes[minetest.get_node(pos).name] and minetest.registered_nodes[minetest.get_node(pos).name].buildable_to - and minetest.registered_nodes[minetest.get_node(upos).name] and minetest.registered_nodes[minetest.get_node(upos).name].walkable then + and minetest.registered_nodes[minetest.get_node(upos).name] and minetest.registered_nodes[minetest.get_node(upos).name].walkable then +-- minetest.chat_send_all(nnprefix) tp.placetrack(pos, nnprefix, placer, itemstack, pointed_thing) if not minetest.settings:get_bool("creative_mode") then itemstack:take_item() |