nodes.lua 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. --[[
  2. More Blocks: node definitions
  3. Copyright (c) 2011-2015 Calinou and contributors.
  4. Licensed under the zlib license. See LICENSE.md for more information.
  5. --]]
  6. local S = moreblocks.intllib
  7. local sound_wood = default.node_sound_wood_defaults()
  8. local sound_stone = default.node_sound_stone_defaults()
  9. local sound_glass = default.node_sound_glass_defaults()
  10. local sound_leaves = default.node_sound_leaves_defaults()
  11. local sound_metal = default.node_sound_metal_defaults()
  12. local function tile_tiles(name)
  13. local tex = "moreblocks_" ..name.. ".png"
  14. return {tex, tex, tex, tex, tex.. "^[transformR90", tex.. "^[transformR90"}
  15. end
  16. local nodes = {
  17. -- Nodes available modified by MustTest.
  18. ["wood_tile"] = {
  19. description = S("Wooden Tile"),
  20. groups = utility.dig_groups("wood", {flammable = 3}),
  21. tiles = {"default_wood.png^moreblocks_wood_tile.png",
  22. "default_wood.png^moreblocks_wood_tile.png",
  23. "default_wood.png^moreblocks_wood_tile.png",
  24. "default_wood.png^moreblocks_wood_tile.png",
  25. "default_wood.png^moreblocks_wood_tile.png^[transformR90",
  26. "default_wood.png^moreblocks_wood_tile.png^[transformR90"},
  27. sounds = sound_wood,
  28. paramtype2 = "facedir",
  29. },
  30. ["wood_tile_center"] = {
  31. description = S("Centered Wooden Tile"),
  32. groups = utility.dig_groups("wood", {flammable = 3}),
  33. tiles = {"default_wood.png^moreblocks_wood_tile_center.png"},
  34. sounds = sound_wood,
  35. no_stairs = true,
  36. },
  37. ["wood_tile_full"] = {
  38. description = S("Full Wooden Tile"),
  39. groups = utility.dig_groups("wood", {flammable = 3}),
  40. tiles = tile_tiles("wood_tile_full"),
  41. sounds = sound_wood,
  42. },
  43. ["wood_tile_up"] = {
  44. description = S("Upwards Wooden Tile"),
  45. groups = utility.dig_groups("wood", {flammable = 3}),
  46. tiles = {"default_wood.png^moreblocks_wood_tile_up.png"},
  47. sounds = sound_wood,
  48. no_stairs = true,
  49. paramtype2 = "facedir",
  50. },
  51. ["wood_tile_down"] = {
  52. description = S("Downwards Wooden Tile"),
  53. groups = utility.dig_groups("wood", {flammable = 3}),
  54. tiles = {"default_wood.png^[transformR180^moreblocks_wood_tile_up.png^[transformR180"},
  55. sounds = sound_wood,
  56. no_stairs = true,
  57. paramtype2 = "facedir",
  58. },
  59. ["wood_tile_left"] = {
  60. description = S("Rightwards Wooden Tile"),
  61. groups = utility.dig_groups("wood", {flammable = 3}),
  62. tiles = {"default_wood.png^[transformR270^moreblocks_wood_tile_up.png^[transformR270"},
  63. sounds = sound_wood,
  64. no_stairs = true,
  65. paramtype2 = "facedir",
  66. },
  67. ["wood_tile_right"] = {
  68. description = S("Leftwards Wooden Tile"),
  69. groups = utility.dig_groups("wood", {flammable = 3}),
  70. tiles = {"default_wood.png^[transformR90^moreblocks_wood_tile_up.png^[transformR90"},
  71. sounds = sound_wood,
  72. no_stairs = true,
  73. paramtype2 = "facedir",
  74. },
  75. ["circle_stone_bricks"] = {
  76. description = S("Circle Stone"),
  77. groups = utility.dig_groups("brick"),
  78. sounds = sound_stone,
  79. no_stairs = true,
  80. },
  81. ["circle_sandstone"] = {
  82. description = S("Circle Sandstone"),
  83. groups = utility.dig_groups("brick"),
  84. sounds = sound_stone,
  85. no_stairs = true,
  86. },
  87. ["circle_desert_stone_bricks"] = {
  88. description = S("Circle Desert Stone"),
  89. groups = utility.dig_groups("brick"),
  90. sounds = sound_stone,
  91. no_stairs = true,
  92. },
  93. ["grey_bricks"] = {
  94. description = S("Stone Bricks"),
  95. groups = utility.dig_groups("brick"),
  96. sounds = sound_stone,
  97. },
  98. ["coal_stone_bricks"] = {
  99. description = S("Coal Stone Bricks"),
  100. groups = utility.dig_groups("brick"),
  101. sounds = sound_stone,
  102. paramtype2 = "facedir",
  103. place_param2 = 0,
  104. },
  105. ["iron_stone_bricks"] = {
  106. description = S("Iron Stone Bricks"),
  107. groups = utility.dig_groups("brick"),
  108. sounds = sound_stone,
  109. paramtype2 = "facedir",
  110. place_param2 = 0,
  111. },
  112. ["stone_tile"] = {
  113. description = S("Stone Tile"),
  114. groups = utility.dig_groups("brick"),
  115. sounds = sound_stone,
  116. },
  117. ["split_stone_tile"] = {
  118. description = S("Split Stone Tile"),
  119. tiles = {"moreblocks_split_stone_tile_top.png",
  120. "moreblocks_split_stone_tile.png"},
  121. groups = utility.dig_groups("brick"),
  122. sounds = sound_stone,
  123. },
  124. ["split_stone_tile_alt"] = {
  125. description = S("Checkered Stone Tile"),
  126. groups = utility.dig_groups("brick"),
  127. sounds = sound_stone,
  128. no_stairs = true,
  129. },
  130. ["tar"] = {
  131. description = S("Tar"),
  132. groups = utility.dig_groups("stone", {tar_block = 1}),
  133. sounds = sound_stone,
  134. -- Tar is treated as solid, rock-like node with road properties.
  135. --no_stairs = true,
  136. movement_speed_multiplier = default.ROAD_SPEED,
  137. },
  138. ["plankstone"] = {
  139. description = S("Plankstone"),
  140. groups = utility.dig_groups("brick"),
  141. tiles = tile_tiles("plankstone"),
  142. sounds = sound_stone,
  143. },
  144. ["coal_stone"] = {
  145. description = S("Coal Stone"),
  146. groups = utility.dig_groups("hardstone"),
  147. sounds = sound_stone,
  148. },
  149. ["iron_stone"] = {
  150. description = S("Iron Stone"),
  151. groups = utility.dig_groups("brick"),
  152. sounds = sound_stone,
  153. },
  154. ["coal_checker"] = {
  155. description = S("Coal Checker"),
  156. tiles = {"moreblocks_coal_checker.png"},
  157. groups = utility.dig_groups("brick"),
  158. sounds = sound_stone,
  159. },
  160. ["iron_checker"] = {
  161. description = S("Iron Checker"),
  162. tiles = {"moreblocks_iron_checker.png"},
  163. groups = utility.dig_groups("brick"),
  164. sounds = sound_stone,
  165. },
  166. ["glow_glass"] = {
  167. description = S("Glow Glass"),
  168. drawtype = "glasslike_framed_optional",
  169. --tiles = {"moreblocks_glow_glass.png", "moreblocks_glow_glass_detail.png"},
  170. tiles = {"moreblocks_glow_glass.png"},
  171. paramtype = "light",
  172. sunlight_propagates = true,
  173. light_source = 11,
  174. groups = utility.dig_groups("glass"),
  175. sounds = sound_glass,
  176. silverpick_drop = true,
  177. drop = {
  178. max_items = 2,
  179. items = {
  180. {
  181. items = {"vessels:glass_fragments", "glowstone:glowing_dust"},
  182. rarity = 1,
  183. },
  184. }
  185. },
  186. },
  187. ["super_glow_glass"] = {
  188. description = S("Super Glow Glass"),
  189. drawtype = "glasslike_framed_optional",
  190. --tiles = {"moreblocks_super_glow_glass.png", "moreblocks_super_glow_glass_detail.png"},
  191. tiles = {"moreblocks_super_glow_glass.png"},
  192. paramtype = "light",
  193. sunlight_propagates = true,
  194. light_source = 14,
  195. groups = utility.dig_groups("glass"),
  196. sounds = sound_glass,
  197. silverpick_drop = true,
  198. drop = {
  199. max_items = 2,
  200. items = {
  201. {
  202. items = {"vessels:glass_fragments", "glowstone:glowing_dust 2"},
  203. rarity = 1,
  204. },
  205. }
  206. },
  207. },
  208. ["copperpatina"] = {
  209. description = S("Copper Patina Block"),
  210. groups = utility.dig_groups("block"),
  211. sounds = sound_metal,
  212. },
  213. ["gold_tile"] = {
  214. description = S("Etched Gold"),
  215. groups = utility.dig_groups("block"),
  216. sounds = sound_metal,
  217. },
  218. ["mithril_tile"] = {
  219. description = S("Etched Mithril"),
  220. groups = utility.dig_groups("block"),
  221. sounds = sound_metal,
  222. },
  223. ["silver_tile"] = {
  224. description = S("Etched Silver"),
  225. groups = utility.dig_groups("block"),
  226. sounds = sound_metal,
  227. },
  228. }
  229. for name, def in pairs(nodes) do
  230. def.tiles = def.tiles or {"moreblocks_" .. name .. ".png"}
  231. minetest.register_node("moreblocks:" .. name, def)
  232. -- I don't need aliases. By MustTest
  233. --minetest.register_alias(name, "moreblocks:" ..name)
  234. if not def.no_stairs then
  235. local groups = utility.copy_builtin_groups(def.groups or {})
  236. assert(type(def.tiles) == "table")
  237. stairs.register_stair_and_slab(
  238. name,
  239. "moreblocks:" .. name,
  240. groups,
  241. def.tiles,
  242. def.description,
  243. def.sounds
  244. )
  245. --[[
  246. local groups = {}
  247. for k, v in pairs(def.groups) do groups[k] = v end
  248. stairsplus:register_all("moreblocks", name, "moreblocks:" ..name, {
  249. description = def.description,
  250. groups = groups,
  251. tiles = def.tiles,
  252. sunlight_propagates = def.sunlight_propagates,
  253. light_source = def.light_source,
  254. sounds = def.sounds,
  255. })
  256. --]]
  257. end
  258. end
  259. minetest.override_item("stairs:slab_super_glow_glass", {
  260. light_source = 14,
  261. sunlight_propagates = true,
  262. })
  263. minetest.override_item("stairs:stair_super_glow_glass", {
  264. light_source = 14,
  265. sunlight_propagates = true,
  266. })
  267. minetest.override_item("stairs:slab_glow_glass", {
  268. light_source = 11,
  269. sunlight_propagates = true,
  270. })
  271. minetest.override_item("stairs:stair_glow_glass", {
  272. light_source = 11,
  273. sunlight_propagates = true,
  274. })
  275. -- Items
  276. --[[
  277. minetest.register_craftitem("moreblocks:sweeper", {
  278. description = S("Sweeper"),
  279. inventory_image = "moreblocks_sweeper.png",
  280. })
  281. minetest.register_craftitem("moreblocks:nothing", {
  282. inventory_image = "invisible.png",
  283. on_use = function() end,
  284. })
  285. --]]