init.lua 762 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. mr_extra = mr_extra or {}
  2. mr_extra.modpath = minetest.get_modpath("mr_extra")
  3. local rocks = {
  4. "serpentine",
  5. "marble_pink",
  6. "marble_white",
  7. "marble",
  8. "marble_bricks",
  9. "granite",
  10. }
  11. for k, v in ipairs(rocks) do
  12. local basename = "morerocks:" .. v
  13. local ndef = minetest.registered_nodes[basename]
  14. if ndef then
  15. -- Stairs.
  16. stairs.register_stair_and_slab(
  17. "morerocks_" .. v,
  18. basename,
  19. utility.copy_builtin_groups(ndef.groups),
  20. ndef.tiles, -- Accepts a table.
  21. ndef.description,
  22. ndef.sounds
  23. )
  24. -- Walls/castle stuff.
  25. local image = ndef.tiles[1]
  26. if type(image) == "string" then
  27. walls.register(
  28. "morerocks_" .. v,
  29. ndef.description,
  30. image, -- Only accepts a string!
  31. basename,
  32. ndef.sounds
  33. )
  34. end
  35. end
  36. end