stairs_functions.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. if minetest.get_modpath("moreblocks") then
  2. function darkage.register_stairs(nodeName)
  3. local ndef = assert(minetest.registered_nodes[nodeName], "Error: "..nodeName.." is not registered")
  4. local mod = "darkage"
  5. local node = nodeName:split(":")[2]
  6. stairsplus:register_all(mod, node, nodeName, ndef)
  7. end
  8. elseif minetest.get_modpath("stairs") then
  9. function darkage.register_stairs(nodeName)
  10. local ndef = assert(minetest.registered_nodes[nodeName], "Error: "..nodeName.." is not registered")
  11. local node = nodeName:split(":")[2]
  12. -- The stairs api does not allow to use the darkage modname, so we have to call the nodes stairs:stair_darkage_
  13. -- and creating an alias
  14. local subname = "darkage_".. node;
  15. stairs.register_stair_and_slab(subname, nodeName,
  16. ndef.groups, ndef.tiles,
  17. ndef.description.." Stair", ndef.description.." Slab",
  18. ndef.sounds)
  19. --stairs.register_stair_and_slab(subname, recipeitem,
  20. -- groups, images,
  21. -- desc_stair, desc_slab, sounds)
  22. minetest.register_alias("darkage:stair_"..node, "stairs:stair_darkage_"..node)
  23. minetest.register_alias("darkage:slab_"..node, "stairs:slab_darkage_"..node)
  24. end
  25. end