nodes.lua 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918
  1. --[[
  2. More Blocks: node definitions
  3. Copyright (c) 2011-2017 Hugo Locurcio and contributors.
  4. 2018-2022 Och_Noe
  5. Licensed under the zlib license. See LICENSE.md for more information.
  6. --]]
  7. local S = moreblocks.intllib
  8. local sound_dirt = default.node_sound_dirt_defaults()
  9. local sound_wood = default.node_sound_wood_defaults()
  10. local sound_stone = default.node_sound_stone_defaults()
  11. local sound_glass = default.node_sound_glass_defaults()
  12. local sound_leaves = default.node_sound_leaves_defaults()
  13. local sound_gravel = default.node_sound_gravel_defaults()
  14. -- Don't break on 0.4.14 and earlier.
  15. local sound_metal = (default.node_sound_metal_defaults
  16. and default.node_sound_metal_defaults() or sound_stone)
  17. local function tile_tiles(name)
  18. local tex = "moreblocks_" ..name.. ".png"
  19. return {tex, tex, tex, tex, tex.. "^[transformR90", tex.. "^[transformR90"}
  20. end
  21. local use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "blend" or true
  22. local box_slope = {
  23. type = "fixed",
  24. fixed = {
  25. {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
  26. {-0.5, -0.25, -0.25, 0.5, 0, 0.5},
  27. {-0.5, 0, 0, 0.5, 0.25, 0.5},
  28. {-0.5, 0.25, 0.25, 0.5, 0.5, 0.5}
  29. }
  30. }
  31. local box_slope_half = {
  32. type = "fixed",
  33. fixed = {
  34. {-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
  35. {-0.5, -0.375, -0.25, 0.5, -0.25, 0.5},
  36. {-0.5, -0.25, 0, 0.5, -0.125, 0.5},
  37. {-0.5, -0.125, 0.25, 0.5, 0, 0.5},
  38. }
  39. }
  40. local box_slope_half_raised = {
  41. type = "fixed",
  42. fixed = {
  43. {-0.5, -0.5, -0.5, 0.5, 0.125, 0.5},
  44. {-0.5, 0.125, -0.25, 0.5, 0.25, 0.5},
  45. {-0.5, 0.25, 0, 0.5, 0.375, 0.5},
  46. {-0.5, 0.375, 0.25, 0.5, 0.5, 0.5},
  47. }
  48. }
  49. local box_slope_third = {
  50. type = "fixed",
  51. fixed = {
  52. {-0.5, -0.5, -0.5, 0.5, -0.417 , 0.5},
  53. {-0.5, -0.417, -0.25, 0.5, -0.333 , 0.5},
  54. {-0.5, -0.333, 0, 0.5, -0.250 , 0.5},
  55. {-0.5, -0.250, 0.25, 0.5, -0.167, 0.5},
  56. }
  57. }
  58. local box_slope_third_raised = {
  59. type = "fixed",
  60. fixed = {
  61. {-0.5, -0.5, -0.5, 0.5, -0.083 , 0.5},
  62. {-0.5, -0.083, -0.25, 0.5, 0 , 0.5},
  63. {-0.5, 0 , 0, 0.5, 0.083 , 0.5},
  64. {-0.5, 0.083, 0.25, 0.5, 0.167, 0.5},
  65. }
  66. }
  67. local box_slope_third_top = {
  68. type = "fixed",
  69. fixed = {
  70. {-0.5, -0.5, -0.5, 0.5, 0.250, 0.5},
  71. {-0.5, 0.250, -0.25, 0.5, 0.333, 0.5},
  72. {-0.5, 0.333, 0, 0.5, 0.417, 0.5},
  73. {-0.5, 0.417, 0.25, 0.5, 0.5 , 0.5},
  74. }
  75. }
  76. local minimal_slopes_defs = {
  77. [""] = {
  78. mesh = "moreblocks_slope.obj",
  79. collision_box = box_slope,
  80. selection_box = box_slope,
  81. },
  82. ["_half"] = {
  83. mesh = "moreblocks_slope_half.obj",
  84. collision_box = box_slope_half,
  85. selection_box = box_slope_half,
  86. },
  87. ["_half_raised"] = {
  88. mesh = "moreblocks_slope_half_raised.obj",
  89. collision_box = box_slope_half_raised,
  90. selection_box = box_slope_half_raised,
  91. },
  92. }
  93. local function copytable(orig)
  94. local orig_type = type(orig)
  95. local copy
  96. if orig_type == 'table' then
  97. copy = {}
  98. for orig_key, orig_value in next, orig, nil do
  99. copy[copytable(orig_key)] = copytable(orig_value)
  100. end
  101. setmetatable(copy, copytable(getmetatable(orig)))
  102. else
  103. copy = orig
  104. end
  105. return copy
  106. end
  107. local function register_minimal_shapes(modname, subname, recipeitem, fields)
  108. local defs = copytable(minimal_slopes_defs)
  109. local desc = S("%s Slope"):format(fields.description)
  110. local use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "blend" or fields.use_texture_alpha
  111. for alternate, def in pairs(defs) do
  112. for k, v in pairs(fields) do
  113. def[k] = v
  114. end
  115. def.drawtype = "mesh"
  116. def.paramtype = "light"
  117. def.paramtype2 = def.paramtype2 or "facedir"
  118. def.on_place = minetest.rotate_node
  119. def.description = desc
  120. def.use_texture_alpha = use_texture_alpha
  121. def.groups = def.groups -- stairsplus:prepare_groups(fields.groups)
  122. if fields.drop and not (type(fields.drop) == "table") then
  123. def.drop = modname.. ":slope_" ..fields.drop..alternate
  124. end
  125. minetest.register_node(":" ..modname.. ":slope_" ..subname..alternate, def)
  126. end
  127. minetest.register_craft({
  128. recipe = {
  129. { "","","" },
  130. { "","",recipeitem, },
  131. { "", recipeitem, recipeitem },
  132. },
  133. output = modname .. ":slope_" .. subname
  134. })
  135. minetest.register_craft({
  136. recipe = {
  137. { "","","" },
  138. { "","","", },
  139. { "", recipeitem, recipeitem },
  140. },
  141. output = modname .. ":slope_" .. subname .. "_half 12"
  142. })
  143. minetest.register_craft({
  144. recipe = {
  145. { "","",recipeitem, },
  146. { "","","" },
  147. { "", recipeitem, recipeitem },
  148. },
  149. output = modname .. ":slope_" .. subname .. "_half_raised 4"
  150. })
  151. minetest.register_craft({
  152. type = "shapeless",
  153. output = recipeitem,
  154. recipe = {modname .. ":slope_" .. subname, modname .. ":slope_" .. subname},
  155. })
  156. minetest.register_craft({
  157. type = "shapeless",
  158. output = recipeitem,
  159. recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half_raised"},
  160. })
  161. -- 100% slope 1 node
  162. -- 50% slope 2 nodes
  163. -- 50% slab 1 node
  164. end
  165. local nodes = {
  166. ["wood_tile"] = {
  167. description = S("Wooden Tile"),
  168. groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
  169. tiles = {"default_wood.png^moreblocks_wood_tile.png",
  170. "default_wood.png^moreblocks_wood_tile.png",
  171. "default_wood.png^moreblocks_wood_tile.png",
  172. "default_wood.png^moreblocks_wood_tile.png",
  173. "default_wood.png^moreblocks_wood_tile.png^[transformR90",
  174. "default_wood.png^moreblocks_wood_tile.png^[transformR90"},
  175. sounds = sound_wood,
  176. },
  177. ["wood_tile_flipped"] = {
  178. description = S("Wooden Tile"),
  179. groups = {wood = 1, snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
  180. tiles = {"default_wood.png^moreblocks_wood_tile.png^[transformR90",
  181. "default_wood.png^moreblocks_wood_tile.png^[transformR90",
  182. "default_wood.png^moreblocks_wood_tile.png^[transformR90",
  183. "default_wood.png^moreblocks_wood_tile.png^[transformR90",
  184. "default_wood.png^moreblocks_wood_tile.png^[transformR180",
  185. "default_wood.png^moreblocks_wood_tile.png^[transformR180"},
  186. sounds = sound_wood,
  187. no_stairs = true,
  188. },
  189. ["wood_tile_center"] = {
  190. description = S("Centered Wooden Tile"),
  191. groups = {wood = 1, snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
  192. tiles = {"default_wood.png^moreblocks_wood_tile_center.png"},
  193. sounds = sound_wood,
  194. },
  195. ["wood_tile_full"] = {
  196. description = S("Full Wooden Tile"),
  197. groups = {wood = 1, snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
  198. tiles = tile_tiles("wood_tile_full"),
  199. sounds = sound_wood,
  200. },
  201. ["wood_tile_up"] = {
  202. description = S("Upwards Wooden Tile"),
  203. groups = {wood = 1, snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
  204. tiles = {"default_wood.png^moreblocks_wood_tile_up.png"},
  205. sounds = sound_wood,
  206. no_stairs = true,
  207. },
  208. ["wood_tile_down"] = {
  209. description = S("Downwards Wooden Tile"),
  210. groups = {wood = 1, snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
  211. tiles = {"default_wood.png^[transformR180^moreblocks_wood_tile_up.png^[transformR180"},
  212. sounds = sound_wood,
  213. no_stairs = true,
  214. },
  215. ["wood_tile_left"] = {
  216. description = S("Leftwards Wooden Tile"),
  217. groups = {wood = 1, snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
  218. tiles = {"default_wood.png^[transformR270^moreblocks_wood_tile_up.png^[transformR270"},
  219. sounds = sound_wood,
  220. no_stairs = true,
  221. },
  222. ["wood_tile_right"] = {
  223. description = S("Rightwards Wooden Tile"),
  224. groups = {wood = 1, snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
  225. tiles = {"default_wood.png^[transformR90^moreblocks_wood_tile_up.png^[transformR90"},
  226. sounds = sound_wood,
  227. no_stairs = true,
  228. },
  229. ["circle_stone_bricks"] = {
  230. description = S("Circle Stone Bricks"),
  231. groups = {cracky = 3},
  232. sounds = sound_stone,
  233. },
  234. ["grey_bricks"] = {
  235. description = S("Stone Bricks"),
  236. groups = {cracky = 3},
  237. sounds = sound_stone,
  238. },
  239. ["coal_stone_bricks"] = {
  240. description = S("Coal Stone Bricks"),
  241. groups = {cracky = 3},
  242. sounds = sound_stone,
  243. },
  244. ["iron_stone_bricks"] = {
  245. description = S("Iron Stone Bricks"),
  246. groups = {cracky = 3},
  247. sounds = sound_stone,
  248. },
  249. ["stone_tile"] = {
  250. description = S("Stone Tile"),
  251. groups = {cracky = 3},
  252. sounds = sound_stone,
  253. },
  254. ["split_stone_tile"] = {
  255. description = S("Split Stone Tile"),
  256. tiles = {"moreblocks_split_stone_tile_top.png",
  257. "moreblocks_split_stone_tile.png"},
  258. groups = {cracky = 3},
  259. sounds = sound_stone,
  260. },
  261. ["split_stone_tile_alt"] = {
  262. description = S("Checkered Stone Tile"),
  263. groups = {cracky = 3},
  264. sounds = sound_stone,
  265. },
  266. ["tar"] = {
  267. description = S("Tar"),
  268. groups = {cracky = 2, tar_block = 1},
  269. sounds = sound_stone,
  270. },
  271. ["dirt_compressed"] = {
  272. description = S("Compressed Dirt"),
  273. groups = {crumbly=2},
  274. is_ground_content = false,
  275. sounds = sound_dirt,
  276. },
  277. ["cobble_compressed"] = {
  278. description = S("Compressed Cobblestone"),
  279. groups = {cracky = 1},
  280. sounds = sound_stone,
  281. },
  282. ["cobble_condensed"] = {
  283. description = "Condensed Cobblestone",
  284. tiles = {"moreblocks_cobble_compressed.png^[colorize:black:255]"},
  285. is_ground_content = false,
  286. groups = {cracky = 1, stone = 2},
  287. stack_max = 999,
  288. sounds = default.node_sound_stone_defaults(),
  289. },
  290. ["plankstone"] = {
  291. description = S("Plankstone"),
  292. groups = {cracky = 3},
  293. tiles = tile_tiles("plankstone"),
  294. sounds = sound_stone,
  295. },
  296. ["iron_glass"] = {
  297. description = S("Iron Glass"),
  298. drawtype = "glasslike_framed_optional",
  299. tiles = {"moreblocks_iron_glass.png", "moreblocks_iron_glass_detail.png"},
  300. --tiles = {"moreblocks_iron_glass.png"},
  301. one_texture = true,
  302. paramtype = "light",
  303. sunlight_propagates = true,
  304. groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3},
  305. sounds = sound_glass,
  306. },
  307. ["coal_glass"] = {
  308. description = S("Coal Glass"),
  309. drawtype = "glasslike_framed_optional",
  310. tiles = {"moreblocks_coal_glass.png", "moreblocks_coal_glass_detail.png"},
  311. --tiles = {"moreblocks_coal_glass.png"},
  312. one_texture = true,
  313. paramtype = "light",
  314. sunlight_propagates = true,
  315. groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3},
  316. sounds = sound_glass,
  317. },
  318. ["clean_glass"] = {
  319. description = S("Clean Glass"),
  320. drawtype = "glasslike_framed_optional",
  321. tiles = {"moreblocks_clean_glass.png", "moreblocks_clean_glass_detail.png"},
  322. -- tiles = {"moreblocks_clean_glass.png"},
  323. one_texture = true,
  324. paramtype = "light",
  325. sunlight_propagates = true,
  326. groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3},
  327. sounds = sound_glass,
  328. },
  329. ["cactus_brick"] = {
  330. description = S("Cactus Brick"),
  331. groups = {cracky = 3},
  332. sounds = sound_stone,
  333. },
  334. ["cactus_checker"] = {
  335. description = S("Cactus Checker"),
  336. groups = {cracky = 3},
  337. tiles = {"default_stone.png^moreblocks_cactus_checker.png",
  338. "default_stone.png^moreblocks_cactus_checker.png",
  339. "default_stone.png^moreblocks_cactus_checker.png",
  340. "default_stone.png^moreblocks_cactus_checker.png",
  341. "default_stone.png^moreblocks_cactus_checker.png^[transformR90",
  342. "default_stone.png^moreblocks_cactus_checker.png^[transformR90"},
  343. sounds = sound_stone,
  344. },
  345. ["empty_bookshelf"] = {
  346. description = S("Empty Bookshelf"),
  347. tiles = {"default_wood.png", "default_wood.png",
  348. "moreblocks_empty_bookshelf.png"},
  349. groups = {snappy = 2, choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
  350. sounds = sound_wood,
  351. furnace_burntime = 15,
  352. no_stairs = true,
  353. },
  354. ["coal_stone"] = {
  355. description = S("Coal Stone"),
  356. groups = {cracky = 3},
  357. sounds = sound_stone,
  358. },
  359. ["iron_stone"] = {
  360. description = S("Iron Stone"),
  361. groups = {cracky = 3},
  362. sounds = sound_stone,
  363. },
  364. ["coal_checker"] = {
  365. description = S("Coal Checker"),
  366. tiles = {"default_stone.png^moreblocks_coal_checker.png",
  367. "default_stone.png^moreblocks_coal_checker.png",
  368. "default_stone.png^moreblocks_coal_checker.png",
  369. "default_stone.png^moreblocks_coal_checker.png",
  370. "default_stone.png^moreblocks_coal_checker.png^[transformR90",
  371. "default_stone.png^moreblocks_coal_checker.png^[transformR90"},
  372. groups = {cracky = 3},
  373. sounds = sound_stone,
  374. },
  375. ["iron_checker"] = {
  376. description = S("Iron Checker"),
  377. tiles = {"default_stone.png^moreblocks_iron_checker.png",
  378. "default_stone.png^moreblocks_iron_checker.png",
  379. "default_stone.png^moreblocks_iron_checker.png",
  380. "default_stone.png^moreblocks_iron_checker.png",
  381. "default_stone.png^moreblocks_iron_checker.png^[transformR90",
  382. "default_stone.png^moreblocks_iron_checker.png^[transformR90"},
  383. groups = {cracky = 3},
  384. sounds = sound_stone,
  385. },
  386. ["trap_stone"] = {
  387. description = S("Trap Stone"),
  388. walkable = false,
  389. groups = {cracky = 3},
  390. sounds = sound_stone,
  391. no_stairs = true,
  392. },
  393. ["trap_desert_stone"] = {
  394. description = S("Trap Desert Stone"),
  395. drawtype = "glasslike_framed",
  396. tiles = {"default_desert_stone.png^moreblocks_trap_box.png"},
  397. walkable = false,
  398. groups = {cracky = 3},
  399. paramtype = "light",
  400. is_ground_content = false,
  401. sounds = sound_stone,
  402. no_stairs = true,
  403. },
  404. ["trap_glass"] = {
  405. description = S("Trap Glass"),
  406. drawtype = "glasslike_framed_optional",
  407. tiles = {"moreblocks_trap_glass.png", "default_glass_detail.png"},
  408. --tiles = {"moreblocks_trap_glass.png"},
  409. paramtype = "light",
  410. sunlight_propagates = true,
  411. walkable = false,
  412. groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3},
  413. sounds = sound_glass,
  414. no_stairs = true,
  415. },
  416. ["trap_obsidian_glass"] = {
  417. description = S("Trap Obsidian Glass"),
  418. drawtype = "glasslike_framed_optional",
  419. tiles = {"default_obsidian_glass.png^moreblocks_trap_box_glass.png", "default_obsidian_glass_detail.png"},
  420. paramtype = "light",
  421. sunlight_propagates = true,
  422. is_ground_content = false,
  423. walkable = false,
  424. groups = {cracky = 3, oddly_breakable_by_hand = 3},
  425. sounds = sound_glass,
  426. no_stairs = true,
  427. },
  428. ["trap_obsidian"] = {
  429. description = S("Trap Obsidian"),
  430. drawtype = "glasslike_framed",
  431. tiles = {"default_obsidian.png^moreblocks_trap_box.png"},
  432. walkable = false,
  433. groups = {cracky = 1, level = 2},
  434. paramtype = "light",
  435. is_ground_content = false,
  436. sounds = sound_stone,
  437. no_stairs = true,
  438. },
  439. ["trap_sandstone"] = {
  440. description = S("Trap Sandstone"),
  441. drawtype = "glasslike_framed",
  442. tiles = {"default_sandstone.png^moreblocks_trap_box.png"},
  443. walkable = false,
  444. groups = {crumbly = 1, cracky = 3},
  445. paramtype = "light",
  446. is_ground_content = false,
  447. sounds = sound_stone,
  448. no_stairs = true,
  449. },
  450. ["all_faces_tree"] = {
  451. description = S("All-faces Tree"),
  452. tiles = {"default_tree_top.png"},
  453. groups = {tree = 1,snappy = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
  454. sounds = sound_wood,
  455. furnace_burntime = 30,
  456. },
  457. ["all_faces_jungle_tree"] = {
  458. description = S("All-faces Jungle Tree"),
  459. tiles = {"default_jungletree_top.png"},
  460. groups = {tree = 1,snappy = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
  461. sounds = sound_wood,
  462. furnace_burntime = 30,
  463. },
  464. ["all_faces_pine_tree"] = {
  465. description = S("All-faces Pine Tree"),
  466. tiles = {"default_pine_tree_top.png"},
  467. groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
  468. sounds = sound_wood,
  469. furnace_burntime = 26,
  470. },
  471. ["all_faces_acacia_tree"] = {
  472. description = S("All-faces Acacia Tree"),
  473. tiles = {"default_acacia_tree_top.png"},
  474. groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
  475. sounds = sound_wood,
  476. furnace_burntime = 34,
  477. },
  478. ["all_faces_aspen_tree"] = {
  479. description = S("All-faces Aspen Tree"),
  480. tiles = {"default_aspen_tree_top.png"},
  481. groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
  482. sounds = sound_wood,
  483. furnace_burntime = 22,
  484. },
  485. ["glow_glass"] = {
  486. description = S("Glow Glass"),
  487. drawtype = "glasslike_framed_optional",
  488. tiles = {"moreblocks_glow_glass.png", "moreblocks_glow_glass_detail.png"},
  489. -- tiles = {"moreblocks_glow_glass.png"},
  490. one_texture = true,
  491. paramtype = "light",
  492. sunlight_propagates = true,
  493. light_source = 11,
  494. groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3},
  495. sounds = sound_glass,
  496. },
  497. ["trap_glow_glass"] = {
  498. description = S("Trap Glow Glass"),
  499. drawtype = "glasslike_framed_optional",
  500. tiles = {"moreblocks_trap_glass.png", "moreblocks_glow_glass_detail.png"},
  501. -- tiles = {"moreblocks_trap_glass.png"},
  502. paramtype = "light",
  503. sunlight_propagates = true,
  504. light_source = 11,
  505. walkable = false,
  506. groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3},
  507. sounds = sound_glass,
  508. no_stairs = true,
  509. },
  510. ["super_glow_glass"] = {
  511. description = S("Super Glow Glass"),
  512. drawtype = "glasslike_framed_optional",
  513. tiles = {"moreblocks_super_glow_glass.png", "moreblocks_super_glow_glass_detail.png"},
  514. -- tiles = {"moreblocks_super_glow_glass.png"},
  515. -- tiles = {"default_glass.png^[colorize:#FFFF78"},
  516. one_texture = true,
  517. paramtype = "light",
  518. sunlight_propagates = true,
  519. light_source = 14,
  520. groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3},
  521. sounds = sound_glass,
  522. },
  523. ["dim_glow_glass"] = {
  524. description = S("Dim Glow Glass"),
  525. drawtype = "glasslike_framed_optional",
  526. tiles = {"moreblocks_dim_glow_glass.png"},
  527. -- tiles = {"default_glass.png^[colorize:#FFFF78"},
  528. one_texture = true,
  529. use_texture_alpha = use_texture_alpha,
  530. paramtype = "light",
  531. sunlight_propagates = true,
  532. light_source = 5,
  533. groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3},
  534. sounds = sound_glass,
  535. },
  536. ["bright_glow_glass"] = {
  537. description = S("Bright Glow Glass"),
  538. drawtype = "glasslike_framed_optional",
  539. tiles = {"moreblocks_dim_glow_glass.png"},
  540. -- tiles = {"default_glass.png^[colorize:#FFFF78"},
  541. one_texture = true,
  542. use_texture_alpha = use_texture_alpha,
  543. paramtype = "light",
  544. sunlight_propagates = true,
  545. light_source = 12,
  546. groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3},
  547. sounds = sound_glass,
  548. },
  549. ["red_bright_glow_glass"] = {
  550. description = S("Red Bright Glow Glass"),
  551. drawtype = "glasslike_framed_optional",
  552. tiles = {"moreblocks_dim_glow_glass.png^[multiply:red"},
  553. -- tiles = {"default_meselamp_red.png^[multiply:red"},
  554. -- tiles = {"default_glass.png^[colorize:#FFFF78"},
  555. one_texture = true,
  556. use_texture_alpha = use_texture_alpha,
  557. paramtype = "light",
  558. sunlight_propagates = true,
  559. light_source = 13,
  560. groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3},
  561. sounds = sound_glass,
  562. },
  563. ["low_glow_glass"] = {
  564. description = S("Low Glow Glass"),
  565. drawtype = "glasslike_framed_optional",
  566. tiles = {"moreblocks_low_glow_glass.png"},
  567. -- tiles = {"default_glass.png^[colorize:#FFFF78"},
  568. one_texture = true,
  569. use_texture_alpha = use_texture_alpha,
  570. paramtype = "light",
  571. sunlight_propagates = true,
  572. light_source = 8,
  573. groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3},
  574. sounds = sound_glass,
  575. },
  576. ["trap_super_glow_glass"] = {
  577. description = S("Trap Super Glow Glass"),
  578. drawtype = "glasslike_framed_optional",
  579. tiles = {"moreblocks_trap_super_glow_glass.png", "moreblocks_super_glow_glass_detail.png"},
  580. -- tiles = {"moreblocks_trap_super_glow_glass.png"},
  581. paramtype = "light",
  582. sunlight_propagates = true,
  583. light_source = 14,
  584. walkable = false,
  585. groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3},
  586. sounds = sound_glass,
  587. no_stairs = true,
  588. },
  589. ["rope"] = {
  590. description = S("Rope"),
  591. drawtype = "signlike",
  592. inventory_image = "moreblocks_rope.png",
  593. wield_image = "moreblocks_rope.png",
  594. paramtype = "light",
  595. sunlight_propagates = true,
  596. paramtype2 = "wallmounted",
  597. walkable = false,
  598. climbable = true,
  599. selection_box = {type = "wallmounted",},
  600. groups = {snappy = 3, flammable = 2},
  601. sounds = sound_leaves,
  602. no_stairs = true,
  603. },
  604. ["copperpatina"] = {
  605. description = S("Copper Patina Block"),
  606. groups = {cracky = 1, level = 2},
  607. sounds = sound_metal,
  608. },
  609. ["gravel_stonebrick"] = {
  610. description = S("Gravel on Stonebrick"),
  611. tiles = {"default_gravel.png",
  612. "default_stone_brick.png",
  613. "default_gravel.png^[lowpart:50:default_stone_brick.png",
  614. "default_gravel.png^[lowpart:50:default_stone_brick.png",
  615. "default_gravel.png^[lowpart:50:default_stone_brick.png",
  616. "default_gravel.png^[lowpart:50:default_stone_brick.png"},
  617. no_stairs = true;
  618. groups = {cracky = 3},
  619. sounds = sound_gravel,
  620. },
  621. ["gravel_slope"] = {
  622. description = S("Gravel Slope"),
  623. tiles = { "default_gravel.png" } ,
  624. no_stairs = true,
  625. groups = {crumbly = 2, falling_node = 1, not_blocking_trains = 1},
  626. sounds = sound_gravel,
  627. drawtype = "mesh",
  628. mesh = "moreblocks_slope.obj",
  629. collision_box = box_slope,
  630. selection_box = box_slope,
  631. sunlight_propagates = false,
  632. light_source = 0,
  633. paramtype = "light",
  634. paramtype2 = "facedir", -- neu
  635. on_rotate = screwdriver.rotate_simple , -- neu
  636. is_ground_content = false, --neu
  637. -- buildable_to = true;
  638. },
  639. ["gravel_slope_2a"] = {
  640. description = S("Gravel Slope 2a"),
  641. tiles = { "default_gravel.png" } ,
  642. no_stairs = true,
  643. groups = {crumbly = 2, falling_node = 1, not_blocking_trains = 1},
  644. sounds = sound_gravel,
  645. drawtype = "mesh",
  646. mesh = "moreblocks_slope_half.obj",
  647. collision_box = box_slope_half,
  648. selection_box = box_slope_half,
  649. sunlight_propagates = false,
  650. light_source = 0,
  651. paramtype = "light",
  652. paramtype2 = "facedir", -- neu
  653. on_rotate = screwdriver.rotate_simple , -- neu
  654. is_ground_content = false, --neu
  655. -- buildable_to = true;
  656. },
  657. ["gravel_slope_2b"] = {
  658. description = S("Gravel Slope 2b"),
  659. tiles = { "default_gravel.png" } ,
  660. no_stairs = true,
  661. groups = {crumbly = 2, falling_node = 1, not_blocking_trains = 1},
  662. sounds = sound_gravel,
  663. drawtype = "mesh",
  664. mesh = "moreblocks_slope_half_raised.obj",
  665. collision_box = box_slope_half_raised,
  666. selection_box = box_slope_half_raised,
  667. sunlight_propagates = false,
  668. light_source = 0,
  669. paramtype = "light",
  670. paramtype2 = "facedir", -- neu
  671. on_rotate = screwdriver.rotate_simple , -- neu
  672. is_ground_content = false, --neu
  673. -- buildable_to = true;
  674. },
  675. ["gravel_slope_3a"] = {
  676. description = S("Gravel Slope 3a"),
  677. tiles = { "default_gravel.png" } ,
  678. no_stairs = true,
  679. groups = {crumbly = 2, falling_node = 1, not_blocking_trains = 1},
  680. sounds = sound_gravel,
  681. drawtype = "mesh",
  682. mesh = "moreblocks_slope_third.obj",
  683. collision_box = box_slope_third,
  684. selection_box = box_slope_third,
  685. sunlight_propagates = false,
  686. light_source = 0,
  687. paramtype = "light",
  688. paramtype2 = "facedir", -- neu
  689. on_rotate = screwdriver.rotate_simple , -- neu
  690. is_ground_content = false, --neu
  691. -- buildable_to = true;
  692. },
  693. ["gravel_slope_3b"] = {
  694. description = S("Gravel Slope 3b"),
  695. tiles = { "default_gravel.png" } ,
  696. no_stairs = true,
  697. groups = {crumbly = 2, falling_node = 1, not_blocking_trains = 1},
  698. sounds = sound_gravel,
  699. drawtype = "mesh",
  700. mesh = "moreblocks_slope_third_raised.obj",
  701. collision_box = box_slope_third_raised,
  702. selection_box = box_slope_third_raised,
  703. sunlight_propagates = false,
  704. light_source = 0,
  705. paramtype = "light",
  706. paramtype2 = "facedir", -- neu
  707. on_rotate = screwdriver.rotate_simple , -- neu
  708. is_ground_content = false, --neu
  709. -- buildable_to = true;
  710. },
  711. ["gravel_slope_3c"] = {
  712. description = S("Gravel Slope 3c"),
  713. tiles = { "default_gravel.png" } ,
  714. no_stairs = true,
  715. groups = {crumbly = 2, falling_node = 1, not_blocking_trains = 1},
  716. sounds = sound_gravel,
  717. drawtype = "mesh",
  718. mesh = "moreblocks_slope_third_top.obj",
  719. collision_box = box_slope_third_top,
  720. selection_box = box_slope_third_top,
  721. sunlight_propagates = false,
  722. light_source = 0,
  723. paramtype = "light",
  724. paramtype2 = "facedir", -- neu
  725. on_rotate = screwdriver.rotate_simple , -- neu
  726. is_ground_content = false, --neu
  727. -- buildable_to = true;
  728. },
  729. }
  730. ---------------
  731. local tinted_glass_1 =
  732. {
  733. -- tinted glass from dyes
  734. { "blue", "Blue", "blue1" },
  735. { "cyan", "Cyan", "cyan1" },
  736. { "green", "Green", "green1" },
  737. { "grey", "Grey", "grey1" },
  738. { "red", "Red", "red1" },
  739. { "magenta", "Magenta", "magenta1" },
  740. { "white", "White", "white1" },
  741. { "yellow", "Yellow", "yellow1" },
  742. { "brown", "Brown", "brown2" },
  743. { "dark_green", "Dark Green", "dark_green2" },
  744. { "dark_grey", "Dark Grey", "dark_grey2" },
  745. { "orange", "Orange", "orange2" },
  746. { "pink", "Pink", "pink2" },
  747. { "violet", "Violet", "violet2" },
  748. -- tinted glass from dyes + black
  749. { "dark_magenta" , "Dark Magenta", "dark_magenta2" },
  750. { "dark_orange" , "Dark Orange", "dark_orange2" },
  751. { "dark_pink" , "Dark Pink", "dark_pink2" },
  752. { "dark_red" , "Dark Red", "dark_red2" },
  753. { "dark_violet" , "Dark Violet", "dark_violet2" },
  754. { "dark_yellow" , "Dark Yellow", "dark_yellow2" },
  755. }
  756. for _,f in pairs(tinted_glass_1) do
  757. iname = f[1].."_tinted_glass"
  758. desc = S(f[2].." Tinted Glass")
  759. t_name = {"moreblocks_"..f[3]..".png^moreblocks_clean_glass.png"}
  760. neu = {}
  761. neu.description = desc
  762. neu.drawtype = "glasslike_framed_optional"
  763. neu.tiles = t_name
  764. neu.one_texture = true
  765. neu.use_texture_alpha = use_texture_alpha
  766. neu.paramtype = "light"
  767. neu.sunlight_propagates = true
  768. neu.groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3}
  769. neu.sounds = sound_glass
  770. nodes[iname] = neu
  771. end
  772. ---------------
  773. if minetest.get_modpath("ethereal") then
  774. nodes["all_faces_mushroom_tree"] = {
  775. description = S("All-faces Mushroom Tree"),
  776. tiles = {"mushroom_trunk_top.png"},
  777. groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
  778. sounds = sound_wood,
  779. furnace_burntime = 22,
  780. }
  781. end
  782. for name, def in pairs(nodes) do
  783. def.tiles = def.tiles or {"moreblocks_" ..name.. ".png"}
  784. minetest.register_node("moreblocks:" ..name, def)
  785. minetest.register_alias(name, "moreblocks:" ..name)
  786. local groups = {}
  787. local temp_tiles = def.tiles
  788. if def.one_texture then
  789. temp_tiles = { def.tiles[1]}
  790. end
  791. for k, v in pairs(def.groups) do groups[k] = v end
  792. local use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "blend" or def.use_texture_alpha
  793. if not def.no_stairs then
  794. stairsplus:register_all("moreblocks", name, "moreblocks:" ..name, {
  795. description = def.description,
  796. groups = groups,
  797. tiles = temp_tiles,
  798. sunlight_propagates = def.sunlight_propagates,
  799. light_source = def.light_source,
  800. sounds = def.sounds,
  801. use_texture_alpha = use_texture_alpha
  802. })
  803. else
  804. if def.train_slopes then
  805. end
  806. if def.minimal_shapes then
  807. register_minimal_shapes("moreblocks", name, "moreblocks:" ..name, {
  808. description = def.description,
  809. groups = groups,
  810. tiles = temp_tiles,
  811. sunlight_propagates = def.sunlight_propagates,
  812. light_source = def.light_source,
  813. sounds = def.sounds,
  814. use_texture_alpha = use_texture_alpha
  815. })
  816. end
  817. end
  818. end
  819. -- Items
  820. minetest.register_craftitem("moreblocks:sweeper", {
  821. description = S("Sweeper"),
  822. inventory_image = "moreblocks_sweeper.png",
  823. })
  824. minetest.register_craftitem("moreblocks:nothing", {
  825. inventory_image = "invisible.png",
  826. on_use = function() end,
  827. })
  828. -- ---------------------------
  829. minetest.register_node("moreblocks:meselamp", {
  830. description = S("Mese Lamp red"),
  831. drawtype = "glasslike",
  832. tiles = {"default_meselamp.png^[multiply:red"},
  833. paramtype = "light",
  834. sunlight_propagates = true,
  835. is_ground_content = false,
  836. groups = {cracky = 3, oddly_breakable_by_hand = 3},
  837. sounds = default.node_sound_glass_defaults(),
  838. light_source = default.LIGHT_MAX,
  839. })