stairs.lua 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  1. local grp = {} -- Helper
  2. --= Default Minetest
  3. -- Wood types
  4. stairs.register_all("wood", "default:wood",
  5. {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
  6. {"default_wood.png"},
  7. "Wooden",
  8. stairs.wood, false)
  9. stairs.register_all("junglewood", "default:junglewood",
  10. {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
  11. {"default_junglewood.png"},
  12. "Jungle Wood",
  13. stairs.wood, false)
  14. stairs.register_all("pine_wood", "default:pinewood",
  15. {choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
  16. {"default_pine_wood.png"},
  17. "Pine Wood",
  18. stairs.wood, false)
  19. -- Register aliases for new pine node names
  20. minetest.register_alias("stairs:stair_pinewood", "stairs:stair_pine_wood")
  21. minetest.register_alias("stairs:slab_pinewood", "stairs:slab_pine_wood")
  22. stairs.register_all("acacia_wood", "default:acacia_wood",
  23. {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
  24. {"default_acacia_wood.png"},
  25. "Acacia Wood",
  26. stairs.wood, false)
  27. stairs.register_all("aspen_wood", "default:aspen_wood",
  28. {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
  29. {"default_aspen_wood.png"},
  30. "Aspen Wood",
  31. stairs.wood, false)
  32. -- Stone types
  33. stairs.register_all("stone", "default:stone",
  34. {cracky = 3},
  35. {"default_stone.png"},
  36. "Stone",
  37. stairs.stone, true)
  38. stairs.register_all("stonebrick", "default:stonebrick",
  39. {cracky = 2},
  40. {"default_stone_brick.png"},
  41. "Stone Brick",
  42. stairs.stone, false)
  43. stairs.register_all("stone_block", "default:stone_block",
  44. {cracky = 2},
  45. {"default_stone_block.png"},
  46. "Stone Block",
  47. stairs.stone, true)
  48. stairs.register_all("cobble", "default:cobble",
  49. {cracky = 3},
  50. {"default_cobble.png"},
  51. "Cobble",
  52. stairs.stone, true)
  53. stairs.register_all("mossycobble", "default:mossycobble",
  54. {cracky = 3},
  55. {"default_mossycobble.png"},
  56. "Mossy Cobble",
  57. stairs.stone, true)
  58. stairs.register_all("desert_stone", "default:desert_stone",
  59. {cracky = 3},
  60. {"default_desert_stone.png"},
  61. "Desert Stone",
  62. stairs.stone, true)
  63. stairs.register_all("desert_stonebrick", "default:desert_stonebrick",
  64. {cracky = 2},
  65. {"default_desert_stone_brick.png"},
  66. "Desert Stone Brick",
  67. stairs.stone, false)
  68. stairs.register_all("desert_stone_block", "default:desert_stone_block",
  69. {cracky = 2},
  70. {"default_desert_stone_block.png"},
  71. "Desert Stone Block",
  72. stairs.stone, true)
  73. stairs.register_all("desert_cobble", "default:desert_cobble",
  74. {cracky = 3},
  75. {"default_desert_cobble.png"},
  76. "Desert Cobble",
  77. stairs.stone, true)
  78. -- Sandstone types
  79. stairs.register_all("sandstone", "default:sandstone",
  80. {crumbly = 1, cracky = 3},
  81. {"default_sandstone.png"},
  82. "Sandstone",
  83. stairs.stone, true)
  84. stairs.register_all("sandstonebrick", "default:sandstonebrick",
  85. {cracky = 2},
  86. {"default_sandstone_brick.png"},
  87. "Sandstone Brick",
  88. stairs.stone, false)
  89. stairs.register_all("sandstone_block", "default:sandstone_block",
  90. {cracky = 2},
  91. {"default_sandstone_block.png"},
  92. "Sandstone Block",
  93. stairs.stone, true)
  94. stairs.register_all("desert_sandstone", "default:desert_sandstone",
  95. {crumbly = 1, cracky = 3},
  96. {"default_desert_sandstone.png"},
  97. "Desert Sandstone",
  98. stairs.stone, true)
  99. stairs.register_all("desert_sandstone_brick", "default:desert_sandstone_brick",
  100. {cracky = 2},
  101. {"default_desert_sandstone_brick.png"},
  102. "Desert Sandstone Brick",
  103. stairs.stone, false)
  104. stairs.register_all("desert_sandstone_block", "default:desert_sandstone_block",
  105. {cracky = 2},
  106. {"default_desert_sandstone_block.png"},
  107. "Desert Sandstone Block",
  108. stairs.stone, true)
  109. stairs.register_all("silver_sandstone", "default:silver_sandstone",
  110. {crumbly = 1, cracky = 3},
  111. {"default_silver_sandstone.png"},
  112. "Silver Sandstone",
  113. stairs.stone, true)
  114. stairs.register_all("silver_sandstone_brick", "default:silver_sandstone_brick",
  115. {cracky = 2},
  116. {"default_silver_sandstone_brick.png"},
  117. "Silver Sandstone Brick",
  118. stairs.stone, false)
  119. stairs.register_all("silver_sandstone_block", "default:silver_sandstone_block",
  120. {cracky = 2},
  121. {"default_silver_sandstone_block.png"},
  122. "Silver Sandstone Block",
  123. stairs.stone, true)
  124. -- Obsidian
  125. stairs.register_all("obsidian", "default:obsidian",
  126. {cracky = 1, level = 2},
  127. {"default_obsidian.png"},
  128. "Obsidian",
  129. stairs.stone, true)
  130. stairs.register_all("obsidianbrick", "default:obsidianbrick",
  131. {cracky = 1, level = 2},
  132. {"default_obsidian_brick.png"},
  133. "Obsidian Brick",
  134. stairs.stone, false)
  135. stairs.register_all("obsidian_block", "default:obsidian_block",
  136. {cracky = 1, level = 2},
  137. {"default_obsidian_block.png"},
  138. "Obsidian block",
  139. stairs.stone, true)
  140. -- Cloud (with overrides)
  141. stairs.register_stair("cloud", "default:cloud",
  142. {unbreakable = 1, not_in_creative_inventory = 1},
  143. {"default_cloud.png"},
  144. "Cloud Stair",
  145. stairs.wool)
  146. minetest.override_item("stairs:stair_cloud", {
  147. on_blast = function() end,
  148. on_drop = function(itemstack, dropper, pos) end,
  149. drop = {},
  150. })
  151. stairs.register_slab("cloud", "default:cloud",
  152. {unbreakable = 1, not_in_creative_inventory = 1},
  153. {"default_cloud.png"},
  154. "Cloud Slab",
  155. stairs.wool)
  156. minetest.override_item("stairs:slab_cloud", {
  157. on_blast = function() end,
  158. on_drop = function(itemstack, dropper, pos) end,
  159. drop = {},
  160. })
  161. -- Ores
  162. stairs.register_all("coal", "default:coalblock",
  163. {cracky = 3},
  164. {"default_coal_block.png"},
  165. "Coal",
  166. stairs.stone, true)
  167. stairs.register_all("steelblock", "default:steelblock",
  168. {cracky = 1, level = 2},
  169. {"default_steel_block.png"},
  170. "Steel",
  171. stairs.metal, true)
  172. stairs.register_all("copperblock", "default:copperblock",
  173. {cracky = 1, level = 2},
  174. {"default_copper_block.png"},
  175. "Copper",
  176. stairs.metal, true)
  177. stairs.register_all("bronzeblock", "default:bronzeblock",
  178. {cracky = 1, level = 2},
  179. {"default_bronze_block.png"},
  180. "Bronze",
  181. stairs.metal, true)
  182. stairs.register_all("tinblock", "default:tinblock",
  183. {cracky = 1, level = 2},
  184. {"default_tin_block.png"},
  185. "Tin",
  186. stairs.metal, true)
  187. stairs.register_all("mese", "default:mese",
  188. {cracky = 1, level = 2},
  189. {"default_mese_block.png"},
  190. "Mese",
  191. stairs.stone)
  192. stairs.register_all("goldblock", "default:goldblock",
  193. {cracky = 1},
  194. {"default_gold_block.png"},
  195. "Gold",
  196. stairs.metal)
  197. stairs.register_all("diamondblock", "default:diamondblock",
  198. {cracky = 1, level = 3},
  199. {"default_diamond_block.png"},
  200. "Diamond",
  201. stairs.stone)
  202. -- Glass types
  203. stairs.register_all("glass", "default:glass",
  204. {cracky = 3, oddly_breakable_by_hand = 3},
  205. {"default_glass.png"},
  206. "Glass",
  207. stairs.glass)
  208. stairs.register_all("obsidian_glass", "default:obsidian_glass",
  209. {cracky = 2},
  210. {"default_obsidian_glass.png"},
  211. "Obsidian Glass",
  212. stairs.glass)
  213. -- Brick, Snow and Ice
  214. stairs.register_all("brick", "default:brick",
  215. {cracky = 3},
  216. {"default_brick.png"},
  217. "Brick",
  218. stairs.stone, false)
  219. stairs.register_all("snowblock", "default:snowblock",
  220. {crumbly = 3, cools_lava = 1, snowy = 1},
  221. {"default_snow.png"},
  222. "Snow Block",
  223. default.node_sound_snow_defaults(), true)
  224. stairs.register_all("ice", "default:ice",
  225. {cracky = 3, cools_lava = 1},
  226. {"default_ice.png"},
  227. "Ice",
  228. default.node_sound_glass_defaults(), true)
  229. --= More Ores Mod
  230. if minetest.get_modpath("moreores") then
  231. grp = {cracky = 1, level = 2}
  232. stairs.register_all("silver_block", "moreores:silver_block",
  233. grp,
  234. {"moreores_silver_block.png"},
  235. "Silver",
  236. stairs.metal, true)
  237. stairs.register_all("mithril_block", "moreores:mithril_block",
  238. grp,
  239. {"moreores_mithril_block.png"},
  240. "Mithril",
  241. stairs.metal, true)
  242. end
  243. --= Mobs Mod
  244. if minetest.registered_nodes["mobs:cheeseblock"] then
  245. grp = {crumbly = 3, flammable = 2}
  246. stairs.register_all("cheeseblock", "mobs:cheeseblock",
  247. grp,
  248. {"mobs_cheeseblock.png"},
  249. "Cheese Block",
  250. stairs.dirt)
  251. stairs.register_all("honey_block", "mobs:honey_block",
  252. grp,
  253. {"mobs_honey_block.png"},
  254. "Honey Block",
  255. stairs.dirt)
  256. end
  257. --= Lapis Mod
  258. if minetest.get_modpath("lapis") then
  259. grp = {cracky = 3}
  260. stairs.register_all("lapis_block", "lapis:lapis_block",
  261. grp,
  262. {"lapis_block_side.png"},
  263. "Lapis",
  264. stairs.stone)
  265. stairs.register_all("lapis_brick", "lapis:lapis_brick",
  266. grp,
  267. {"lapis_brick.png"},
  268. "Lapis Brick",
  269. stairs.stone)
  270. stairs.register_all("lapis_cobble", "lapis:lapis_cobble",
  271. grp,
  272. {"lapis_cobble.png"},
  273. "Lapis Cobble",
  274. stairs.stone)
  275. end
  276. --= Homedecor Mod
  277. if minetest.get_modpath("homedecor") then
  278. local grp = {snappy = 3}
  279. stairs.register_all("shingles_asphalt", "homedecor:shingles_asphalt",
  280. grp,
  281. {"homedecor_shingles_asphalt.png"},
  282. "Asphalt Shingle",
  283. stairs.leaves)
  284. stairs.register_all("shingles_terracotta", "homedecor:roof_tile_terracotta",
  285. grp,
  286. {"homedecor_shingles_terracotta.png"},
  287. "Terracotta Shingle",
  288. stairs.leaves)
  289. stairs.register_all("shingles_wood", "homedecor:shingles_wood",
  290. grp,
  291. {"homedecor_shingles_wood.png"},
  292. "Wooden Shingle",
  293. stairs.leaves)
  294. end
  295. --= Xanadu Mod
  296. if minetest.get_modpath("xanadu") then
  297. grp = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3}
  298. stairs.register_all("stained_wood_white", "xanadu:stained_wood_white",
  299. grp,
  300. {"stained_wood_white.png"},
  301. "White Wooden",
  302. stairs.wood, false)
  303. stairs.register_all("stained_wood_red", "xanadu:stained_wood_red",
  304. grp,
  305. {"stained_wood_red.png"},
  306. "Red Wooden",
  307. stairs.wood, false)
  308. -- Decorative blocks
  309. grp = {cracky = 3}
  310. stairs.register_all("stone1", "xanadu:stone1",
  311. grp,
  312. {"stone1.png"},
  313. "Decorative Stone 1",
  314. stairs.stone)
  315. stairs.register_all("stone2", "xanadu:stone2",
  316. grp,
  317. {"stone2.png"},
  318. "Decorative Stone 2",
  319. stairs.stone)
  320. stairs.register_all("stone3", "xanadu:stone3",
  321. grp,
  322. {"stone3.png"},
  323. "Decorative Stone 3",
  324. stairs.stone)
  325. stairs.register_all("stone4", "xanadu:stone4",
  326. grp,
  327. {"stone4.png"},
  328. "Decorative Stone 4",
  329. stairs.stone)
  330. stairs.register_all("stone5", "xanadu:stone5",
  331. grp,
  332. {"stone5.png"},
  333. "Decorative Stone 5",
  334. stairs.stone)
  335. stairs.register_all("stone6", "xanadu:stone6",
  336. grp,
  337. {"stone6.png"},
  338. "Decorative Stone 6",
  339. stairs.stone)
  340. stairs.register_all("sandstonebrick4", "xanadu:sandstonebrick4",
  341. grp,
  342. {"sandstonebrick4.png"},
  343. "Decorative Sandstone 4",
  344. stairs.stone)
  345. stairs.register_slab("desert_cobble1", "xanadu:desert_cobble1",
  346. grp,
  347. {"desert_cobble1.png"},
  348. "Decorative desert cobble 1 slab",
  349. stairs.stone)
  350. stairs.register_slab("desert_cobble5", "xanadu:desert_cobble5",
  351. grp,
  352. {"desert_cobble5.png"},
  353. "Decorative desert cobble 5 slab",
  354. stairs.stone)
  355. stairs.register_slab("desert_stone1", "xanadu:desert_stone1",
  356. grp,
  357. {"desert_stone1.png"},
  358. "Decorative desert stone 1 slab",
  359. stairs.stone)
  360. stairs.register_slab("desert_stone3", "xanadu:desert_stone3",
  361. grp,
  362. {"desert_stone3.png"},
  363. "Decorative desert stone 3 slab",
  364. stairs.stone)
  365. stairs.register_slab("desert_stone4", "xanadu:desert_stone4",
  366. grp,
  367. {"desert_stone4.png"},
  368. "Decorative desert stone 4 slab",
  369. stairs.stone)
  370. stairs.register_stair("desert_stone4", "xanadu:desert_stone4",
  371. grp,
  372. {"desert_stone4.png"},
  373. "Decorative desert stone 4 stair",
  374. stairs.stone)
  375. stairs.register_slab("desert_stone5", "xanadu:desert_stone5",
  376. grp,
  377. {"desert_stone5.png"},
  378. "Decorative desert stone 5 slab",
  379. stairs.stone)
  380. stairs.register_slab("red1", "xanadu:red1",
  381. grp,
  382. {"baked_clay_red1.png"},
  383. "Decorative baked red clay 1 slab",
  384. stairs.stone)
  385. stairs.register_all("bred2", "xanadu:red2",
  386. grp,
  387. {"baked_clay_red2.png"},
  388. "Decorative baked red clay 2",
  389. stairs.stone)
  390. end
  391. --= Castle Mod
  392. if minetest.get_modpath("castle") then
  393. grp = {cracky = 2}
  394. stairs.register_all("dungeon_stone", "castle:dungeon_stone",
  395. grp,
  396. {"castle_dungeon_stone.png"},
  397. "Dungeon",
  398. stairs.stone)
  399. stairs.register_all("stonewall", "castle:stonewall",
  400. grp,
  401. {"castle_stonewall.png"},
  402. "Castle Wall",
  403. stairs.stone)
  404. end
  405. --= Wool Mod
  406. if minetest.get_modpath("wool") then
  407. local colours = {
  408. {"black", "Black", "#000000b0"},
  409. {"blue", "Blue", "#015dbb70"},
  410. {"brown", "Brown", "#a78c4570"},
  411. {"cyan", "Cyan", "#01ffd870"},
  412. {"dark_green", "Dark Green", "#005b0770"},
  413. {"dark_grey", "Dark Grey", "#303030b0"},
  414. {"green", "Green", "#61ff0170"},
  415. {"grey", "Grey", "#5b5b5bb0"},
  416. {"magenta", "Magenta", "#ff05bb70"},
  417. {"orange", "Orange", "#ff840170"},
  418. {"pink", "Pink", "#ff65b570"},
  419. {"red", "Red", "#ff000070"},
  420. {"violet", "Violet", "#2000c970"},
  421. {"white", "White", "#abababc0"},
  422. {"yellow", "Yellow", "#e3ff0070"},
  423. }
  424. for i = 1, #colours, 1 do
  425. stairs.register_all("wool_" .. colours[i][1], "wool:" .. colours[i][1],
  426. {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3, flammable = 3},
  427. {"wool_" .. colours[i][1] .. ".png"},
  428. colours[i][2] .. " Wool",
  429. stairs.wool)
  430. end -- END for
  431. end