slopes.lua 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --[[
  2. More Blocks: slope definitions
  3. Copyright © 2011-2019 Hugo Locurcio and contributors.
  4. Licensed under the zlib license. See LICENSE.md for more information.
  5. --]]
  6. -- Node will be called <modname>:slope_<subname>
  7. -- luacheck: no unused
  8. local function register_slope(modname, subname, recipeitem, groups, images, description, drop, light)
  9. stairsplus:register_slope(modname, subname, recipeitem, {
  10. groups = groups,
  11. tiles = images,
  12. description = description,
  13. drop = drop,
  14. light_source = light,
  15. sounds = default.node_sound_stone_defaults(),
  16. })
  17. end
  18. function stairsplus:register_slope_alias(modname_old, subname_old, modname_new, subname_new)
  19. local defs = table.copy(stairsplus.defs["slope"])
  20. for alternate, def in pairs(defs) do
  21. minetest.register_alias(modname_old .. ":slope_" .. subname_old .. alternate, modname_new .. ":slope_" .. subname_new .. alternate)
  22. end
  23. end
  24. function stairsplus:register_slope_alias_force(modname_old, subname_old, modname_new, subname_new)
  25. local defs = table.copy(stairsplus.defs["slope"])
  26. for alternate, def in pairs(defs) do
  27. minetest.register_alias_force(modname_old .. ":slope_" .. subname_old .. alternate, modname_new .. ":slope_" .. subname_new .. alternate)
  28. end
  29. end
  30. function stairsplus:register_slope(modname, subname, recipeitem, fields)
  31. local defs = table.copy(stairsplus.defs["slope"])
  32. for alternate, def in pairs(defs) do
  33. stairsplus.register_single("slope", alternate, def, modname, subname, recipeitem, fields)
  34. end
  35. circular_saw.known_nodes[recipeitem] = {modname, subname}
  36. end