registrations.lua 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. --[[
  2. More Blocks: registrations
  3. Copyright (c) 2011-2017 Hugo Locurcio and contributors.
  4. Licensed under the zlib license. See LICENSE.md for more information.
  5. --]]
  6. local default_nodes = { -- Default stairs/slabs/panels/microblocks:
  7. "stone",
  8. "stone_block",
  9. "cobble",
  10. "mossycobble",
  11. "brick",
  12. "sandstone",
  13. "steelblock",
  14. "goldblock",
  15. "copperblock",
  16. "bronzeblock",
  17. "diamondblock",
  18. "tinblock",
  19. "desert_stone",
  20. "desert_stone_block",
  21. "desert_cobble",
  22. "meselamp",
  23. "glass",
  24. "tree",
  25. "wood",
  26. "jungletree",
  27. "junglewood",
  28. "pine_tree",
  29. "pine_wood",
  30. "acacia_tree",
  31. "acacia_wood",
  32. "aspen_tree",
  33. "aspen_wood",
  34. "obsidian",
  35. "obsidian_block",
  36. "obsidianbrick",
  37. "obsidian_glass",
  38. "stonebrick",
  39. "desert_stonebrick",
  40. "sandstonebrick",
  41. "silver_sandstone",
  42. "silver_sandstone_brick",
  43. "silver_sandstone_block",
  44. "desert_sandstone",
  45. "desert_sandstone_brick",
  46. "desert_sandstone_block",
  47. "sandstone_block",
  48. "coral_skeleton",
  49. "farming:straw",
  50. -- 2024-12-18
  51. "ice", -- "cave_ice" drops "ice"
  52. "snowblock"
  53. }
  54. if minetest.get_modpath("ehlphabet") then
  55. table.insert(default_nodes,"ehlphabet:block")
  56. end
  57. if minetest.get_modpath("moreores") then
  58. table.insert(default_nodes,"moreores:mithril_block")
  59. -- added 2021-03-30
  60. table.insert(default_nodes,"moreores:silver_block")
  61. end
  62. for _, name in pairs(default_nodes) do
  63. local nodename = "default:"..name
  64. local a,b = string.find(name, ":")
  65. if b then
  66. nodename = name
  67. name = string.sub(name, b+1)
  68. end
  69. local ndef = minetest.registered_nodes[nodename]
  70. if ndef then
  71. local drop
  72. if type(ndef.drop) == "string" then
  73. drop = ndef.drop:sub((b or 8)+1)
  74. end
  75. local tiles = ndef.tiles
  76. if #ndef.tiles > 1 and ndef.drawtype:find("glass") then
  77. tiles = { ndef.tiles[1] }
  78. end
  79. stairsplus:register_all("moreblocks", name, nodename, {
  80. description = ndef.description,
  81. drop = drop,
  82. groups = ndef.groups,
  83. sounds = ndef.sounds,
  84. tiles = tiles,
  85. sunlight_propagates = true,
  86. light_source = ndef.light_source,
  87. use_texture_alpha = ndef.use_texture_alpha
  88. })
  89. end
  90. end
  91. -- wool registrations
  92. if minetest.get_modpath("wool") then
  93. local colorlist = {
  94. {"white", "White Wool"},
  95. {"grey", "Grey Wool"},
  96. {"black", "Black Wool"},
  97. {"red", "Red Wool"},
  98. {"yellow", "Yellow Wool"},
  99. {"green", "Green Wool"},
  100. {"cyan", "Cyan Wool"},
  101. {"blue", "Blue Wool"},
  102. {"magenta", "Magenta Wool"},
  103. {"orange", "Orange Wool"},
  104. {"violet", "Violet Wool"},
  105. {"brown", "Brown Wool"},
  106. {"pink", "Pink Wool"},
  107. {"dark_grey", "Dark Grey Wool"},
  108. {"dark_green", "Dark Green Wool"},
  109. }
  110. for i in ipairs(colorlist) do
  111. local color = colorlist[i][1]
  112. local colordesc = colorlist[i][2]
  113. stairsplus:register_all("wool", color, "wool:"..color, {
  114. description = colordesc,
  115. tiles = {"wool_"..color..".png"},
  116. groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,
  117. flammable=3,wool=1,not_in_creative_inventory=1},
  118. sounds = default.node_sound_defaults(),
  119. sunlight_propagates = true,
  120. })
  121. end
  122. end