decoration.lua 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. --Thanks for all the things in this file, and the related textures goes to catninja!--
  2. -------------
  3. --- Items ---
  4. -------------
  5. -- TREES
  6. -- Vine tree
  7. minetest.register_node("lottblocks:tree_vine", {
  8. description = "Tree With Vines",
  9. tiles = {"lottblocks_tree_vine_top.png", "lottblocks_tree_vine_top.png", "lottblocks_tree_vine.png", "lottblocks_tree_vine.png", "lottblocks_tree_vine.png", "lottblocks_tree_vine.png"},
  10. paramtype2 = "facedir",
  11. is_ground_content = false,
  12. sounds = default.node_sound_wood_defaults(),
  13. groups = {choppy=2,snappy=2},
  14. })
  15. stairs.register_stair_and_slab("tree_vine", "lottblocks:tree_vine",
  16. {choppy=2,snappy=2},
  17. {"lottblocks_tree_vine.png"},
  18. "Tree Vine Stair",
  19. "Tree Vine Slab",
  20. default.node_sound_wood_defaults()
  21. )
  22. -- Mossy tree
  23. minetest.register_node("lottblocks:tree_mossy", {
  24. description = "Tree With Moss",
  25. tiles = {"lottblocks_tree_mossy_top.png", "lottblocks_tree_mossy_top.png", "lottblocks_tree_mossy.png", "lottblocks_tree_mossy.png", "lottblocks_tree_mossy.png", "lottblocks_tree_mossy.png"},
  26. paramtype2 = "facedir",
  27. is_ground_content = false,
  28. sounds = default.node_sound_wood_defaults(),
  29. groups = {choppy=2},
  30. })
  31. stairs.register_stair_and_slab("tree_mossy", "lottblocks:tree_mossy",
  32. {choppy=2},
  33. {"lottblocks_tree_mossy.png"},
  34. "Mossy Tree Stair",
  35. "Mossy Tree Slab",
  36. default.node_sound_wood_defaults()
  37. )
  38. -- Leafroof dark
  39. minetest.register_node("lottblocks:leafroof_dark", {
  40. description = "Dark Leaf Roof",
  41. tiles = {"lottblocks_leafroof.png"},
  42. paramtype = "light",
  43. drawtype = "allfaces_optional",
  44. is_ground_content = false,
  45. sounds = default.node_sound_leaves_defaults(),
  46. groups = {snappy=2,oddly_breakable_by_hand=2,leaves=1},
  47. })
  48. stairs.register_stair_and_slab("leafroof_dark", "lottblocks:leafroof_dark",
  49. {oddly_breakable_by_hand=2,leaves=1},
  50. {"lottblocks_leafroof.png"},
  51. "Dark Leaf Roof Stair",
  52. "Dark Leaf Root Slab",
  53. default.node_sound_leaves_defaults()
  54. )
  55. -- MALLORN
  56. -- Leafroof mallorn
  57. minetest.register_node("lottblocks:leafroof_mallorn", {
  58. description = "Mallorn Leaf Roof",
  59. tiles = {"lottblocks_mallornroof.png"},
  60. paramtype = "light",
  61. drawtype = "allfaces_optional",
  62. is_ground_content = false,
  63. sounds = default.node_sound_leaves_defaults(),
  64. groups = {oddly_breakable_by_hand=2,leaves=1},
  65. })
  66. stairs.register_stair_and_slab("leafroof_mallorn", "lottblocks:leafroof_mallorn",
  67. {oddly_breakable_by_hand=2,leaves=1},
  68. {"lottblocks_mallornroof.png"},
  69. "Mallorn Leaf Roof Stair",
  70. "Mallorn Leaf Roof Slab",
  71. default.node_sound_leaves_defaults()
  72. )
  73. -- mallorn pillar
  74. minetest.register_node("lottblocks:mallorn_pillar", {
  75. description = "Mallorn Pillar",
  76. tiles = {"lottblocks_mallorn_pillar.png"},
  77. paramtype = "light",
  78. paramtype2 = "facedir",
  79. is_ground_content = false,
  80. sounds = default.node_sound_wood_defaults(),
  81. groups = {snappy=2,choppy=2},
  82. })
  83. stairs.register_stair_and_slab("mallorn_pillar", "lottblocks:mallorn_pillar",
  84. {snappy=2,choppy=2},
  85. {"lottblocks_mallorn_pillar.png"},
  86. "Mallorn Pillar Stair",
  87. "Mallorn Pillar Slab",
  88. default.node_sound_wood_defaults()
  89. )
  90. -- mallorn White
  91. minetest.register_node("lottblocks:mallorn_white", {
  92. description = "White Mallorn",
  93. tiles = {"lottblocks_mallorn_white.png"},
  94. paramtype = "light",
  95. paramtype2 = "facedir",
  96. is_ground_content = false,
  97. sounds = default.node_sound_wood_defaults(),
  98. groups = {snappy=2,choppy=2},
  99. })
  100. stairs.register_stair_and_slab("mallorn_white", "lottblocks:mallorn_white",
  101. {snappy=2,choppy=2},
  102. {"lottblocks_mallorn_white.png"},
  103. "White Mallorn Stair",
  104. "White Mallorn Slab",
  105. default.node_sound_wood_defaults()
  106. )
  107. -- DWARFSTONE
  108. -- white
  109. minetest.register_node("lottblocks:dwarfstone_white", {
  110. description = "White Dwarf Stone",
  111. tiles = {"lottblocks_dwarfstone_white_top.png", "lottblocks_dwarfstone_white_top.png", "lottblocks_dwarfstone_white_side.png", "lottblocks_dwarfstone_white_side.png", "lottblocks_dwarfstone_white_side.png", "lottblocks_dwarfstone_white_side.png"},
  112. paramtype2 = "facedir",
  113. is_ground_content = false,
  114. sounds = default.node_sound_stone_defaults(),
  115. groups = {cracky=3},
  116. })
  117. stairs.register_stair_and_slab("dwarfstone_white", "lottblocks:dwarfstone_white",
  118. {cracky=2},
  119. {"lottblocks_dwarfstone_white_top.png"},
  120. "White Dwarf Stone Stair",
  121. "White Dwarf Stone Slab",
  122. default.node_sound_stone_defaults()
  123. )
  124. -- black
  125. minetest.register_node("lottblocks:dwarfstone_black", {
  126. description = "Black Dwarf Stone",
  127. tiles = {"lottblocks_dwarfstone_black_top.png", "lottblocks_dwarfstone_black_top.png", "lottblocks_dwarfstone_black_side.png", "lottblocks_dwarfstone_black_side.png", "lottblocks_dwarfstone_black_side.png", "lottblocks_dwarfstone_black_side.png"},
  128. paramtype2 = "facedir",
  129. is_ground_content = false,
  130. sounds = default.node_sound_stone_defaults(),
  131. groups = {cracky=3},
  132. })
  133. stairs.register_stair_and_slab("dwarfstone_black", "lottblocks:dwarfstone_black",
  134. {cracky=2},
  135. {"lottblocks_dwarfstone_black_top.png"},
  136. "Black Dwarf Stone Stair",
  137. "Black Dwarf Stone Slab",
  138. default.node_sound_stone_defaults()
  139. )
  140. -- stripe
  141. minetest.register_node("lottblocks:dwarfstone_stripe", {
  142. description = "Stripe Dwarf Stone",
  143. tiles = {"lottblocks_dwarfstone_stripe_top.png", "lottblocks_dwarfstone_stripe_bottom.png", "lottblocks_dwarfstone_stripe_l.png", "lottblocks_dwarfstone_stripe_l.png", "lottblocks_dwarfstone_stripe_r.png", "lottblocks_dwarfstone_stripe_r.png"},
  144. paramtype2 = "facedir",
  145. is_ground_content = false,
  146. sounds = default.node_sound_stone_defaults(),
  147. groups = {cracky=3},
  148. })
  149. --------------
  150. --- Crafts ---
  151. --------------
  152. --TREES
  153. -- vine
  154. minetest.register_craft({
  155. output = 'lottblocks:tree_vine 4',
  156. recipe = {
  157. {'default:tree', 'default:grass_1'},
  158. {'default:grass_1', 'default:tree'},
  159. }
  160. })
  161. -- mossy tree
  162. minetest.register_craft({
  163. output = 'lottblocks:tree_mossy 4',
  164. recipe = {
  165. {'default:grass_1', 'default:grass_1', 'default:grass_1'},
  166. {'default:grass_1', 'default:tree', 'default:grass_1'},
  167. {'default:grass_1', 'default:grass_1', 'default:grass_1'},
  168. }
  169. })
  170. -- leafroof dark
  171. minetest.register_craft({
  172. output = 'lottblocks:leafroof_dark',
  173. recipe = {
  174. {'default:leaves', 'default:leaves'},
  175. {'default:leaves', 'default:leaves'},
  176. }
  177. })
  178. -- MALLORN
  179. -- leafroof mallorn
  180. minetest.register_craft({
  181. output = 'lottblocks:leafroof_mallorn',
  182. recipe = {
  183. {'lottplants:mallornleaf', 'lottplants:mallornleaf'},
  184. {'lottplants:mallornleaf', 'lottplants:mallornleaf'},
  185. }
  186. })
  187. -- White mallorn
  188. minetest.register_craft({
  189. output = 'lottblocks:mallorn_white',
  190. recipe = {
  191. {'dye:white'},
  192. {'lottplants:mallornwood'},
  193. }
  194. })
  195. -- Mallorn pillar
  196. minetest.register_craft({
  197. output = 'lottblocks:mallorn_pillar',
  198. recipe = {
  199. {'lottplants:mallorntree', 'default:gold_ingot'},
  200. {'default:gold_ingot', 'lottplants:mallorntree'},
  201. }
  202. })
  203. -- DWARFSTONE
  204. -- white
  205. minetest.register_craft({
  206. output = 'lottblocks:dwarfstone_white 4',
  207. recipe = {
  208. {'default:steel_ingot', 'default:stone', 'default:steel_ingot'},
  209. {'default:stone', 'default:steel_ingot', 'default:stone'},
  210. {'default:steel_ingot', 'default:stone', 'default:steel_ingot'},
  211. }
  212. })
  213. -- black
  214. minetest.register_craft({
  215. output = 'lottblocks:dwarfstone_black 4',
  216. recipe = {
  217. {'default:coal_lump', 'default:stone', 'default:coal_lump'},
  218. {'default:stone', 'default:coal_lump', 'default:stone'},
  219. {'default:coal_lump', 'default:stone', 'default:coal_lump'},
  220. }
  221. })
  222. -- stripe
  223. minetest.register_craft({
  224. output = 'lottblocks:dwarfstone_stripe 4',
  225. recipe = {
  226. {'default:stone', 'default:coal_lump'},
  227. {'default:stone', 'default:coal_lump'},
  228. }
  229. })
  230. -- Dwarf Tombs, by Amaz.
  231. minetest.register_node("lottblocks:dwarf_tomb_top", {
  232. description = "Dwarf Tomb",
  233. drawtype = "nodebox",
  234. tiles = {
  235. "lottblocks_dh_top.png", "default_stone.png",
  236. "lottblocks_dh_side2.png", "lottblocks_dh_side1.png",
  237. "lottblocks_dh_back.png", "lottblocks_dh_front.png",
  238. },
  239. paramtype = "light",
  240. groups = {cracky = 1},
  241. paramtype2 = "facedir",
  242. node_box = {
  243. type = "fixed",
  244. fixed = {
  245. --{x-, y-, z-, x+, y+, z+}
  246. {-0.5, -0.5, -0.5, 0.5, -0.375, 0.5}, -- NodeBox1
  247. {0.4375, -0.375, 0.125, -0.4375, -0.3125, -0.5}, -- NodeBox3
  248. {0.375, -0.3125, 0.125, -0.375, -0.1875, -0.5}, -- NodeBox4
  249. {0.3125, -0.1875, 0.125, -0.3125, -0.0625, -0.5}, -- NodeBox5
  250. {0.125, -0.0625, -0.3125, -0.125, 0.0625, -0.5}, -- NodeBox6
  251. {0.0625, -0.0625, -0.1875, -0.0625, 0, -0.3125}, -- NodeBox7
  252. {0.3125, -0.0625, -0.375, -0.3125, 0, -0.5}, -- NodeBox10
  253. {-0.25, -0.0625, 0, -0.3125, 0, -0.5}, -- NodeBox11
  254. {0.1875, -0.0625, -0.0625, 0.3125, 0, 0.0625}, -- NodeBox13
  255. {0.3125, -0.0625, 0.0625, 0.25, 0, -0.5}, -- NodeBox14
  256. {0.3125, -0.0625, 0.0625, 0.1875, 0, -0.0625}, -- NodeBox16
  257. {0.4375, -0.375, 0.5, -0.4375, -0.0625, 0.125}, -- NodeBox17
  258. {0.25, -0.0625, 0.5, -0.25, 0.0625, 0.0625}, -- NodeBox18
  259. {-0.0625, -0.0625, -0.125, 0.125, 0, 0.125}, -- NodeBox19
  260. }
  261. },
  262. selection_box = {
  263. type = "fixed",
  264. fixed = {
  265. {-0.5, -0.5, -1.5, 0.5, 0.0625, 0.5}
  266. }
  267. },
  268. on_place = function(itemstack, placer, pointed_thing)
  269. local under = pointed_thing.under
  270. local pos
  271. if minetest.registered_items[minetest.get_node(under).name].buildable_to then
  272. pos = under
  273. else
  274. pos = pointed_thing.above
  275. end
  276. if minetest.is_protected(pos, placer:get_player_name()) and
  277. not minetest.check_player_privs(placer, "protection_bypass") then
  278. minetest.record_protection_violation(pos, placer:get_player_name())
  279. return itemstack
  280. end
  281. local node_def = minetest.registered_nodes[minetest.get_node(pos).name]
  282. if not node_def or not node_def.buildable_to then
  283. return itemstack
  284. end
  285. local dir = minetest.dir_to_facedir(placer:get_look_dir())
  286. local botpos = vector.subtract(pos, minetest.facedir_to_dir(dir))
  287. if minetest.is_protected(botpos, placer:get_player_name()) and
  288. not minetest.check_player_privs(placer, "protection_bypass") then
  289. minetest.record_protection_violation(botpos, placer:get_player_name())
  290. return itemstack
  291. end
  292. local botdef = minetest.registered_nodes[minetest.get_node(botpos).name]
  293. if not botdef or not botdef.buildable_to then
  294. return itemstack
  295. end
  296. minetest.set_node(pos, {name = "lottblocks:dwarf_tomb_top", param2 = dir})
  297. minetest.set_node(botpos, {name = "lottblocks:dwarf_tomb_bottom", param2 = dir})
  298. if not minetest.setting_getbool("creative_mode") then
  299. itemstack:take_item()
  300. end
  301. return itemstack
  302. end,
  303. on_destruct = function(pos)
  304. local node = minetest.get_node(pos)
  305. local dir = minetest.facedir_to_dir(node.param2)
  306. local other = vector.subtract(pos, dir)
  307. minetest.remove_node(other)
  308. end,
  309. sounds = default.node_sound_stone_defaults(),
  310. })
  311. minetest.register_node("lottblocks:dwarf_tomb_bottom", {
  312. description = "Dwarf Tomb Bottom",
  313. tiles = {
  314. "lottblocks_db_top.png", "default_stone.png",
  315. "lottblocks_db_side2.png", "lottblocks_db_side1.png",
  316. "lottblocks_db_back.png", "lottblocks_db_front.png",
  317. },
  318. pointable = false,
  319. groups = {not_in_creative_inventory = 1},
  320. paramtype2 = "facedir",
  321. drawtype = "nodebox",
  322. drop = "lottblocks:dwarf_tomb_top",
  323. paramtype = "light",
  324. node_box = {
  325. type = "fixed",
  326. fixed = {
  327. {-0.5, -0.5, -0.5, 0.5, -0.375, 0.5}, -- NodeBox1
  328. {0.4375, -0.375, 0.5, -0.4375, -0.3125, -0.375}, -- NodeBox2
  329. {0.375, -0.3125, 0.5, -0.375, -0.1875, -0.3125}, -- NodeBox3
  330. {0.25, -0.1875, 0.5, -0.25, -0.0625, -0.3125}, -- NodeBox5
  331. {-0.0625, -0.0625, 0.5, 0.0625, 0, 0.375}, -- NodeBox6
  332. {0.0625, -0.0625, 0.375, -0.0625, 0, -0.1875}, -- NodeBox8
  333. {0.25, -0.0625, 0.0625, -0.25, 0, -0.1875}, -- NodeBox8
  334. }
  335. },
  336. sounds = default.node_sound_stone_defaults(),
  337. })
  338. minetest.register_node("lottblocks:snowycobble", {
  339. description = "Snowy Cobblestone",
  340. tiles = {"lottblocks_snowycobble.png"},
  341. is_ground_content = false,
  342. groups = {cracky=3},
  343. })
  344. minetest.register_node("lottblocks:orc_brick", {
  345. description = "Orc Brick",
  346. tiles = {"lottblocks_orc_brick.png"},
  347. is_ground_content = false,
  348. groups = {cracky=2},
  349. })
  350. stairs.register_stair_and_slab("orc_brick", "lottblocks:orc_brick",
  351. {cracky=2},
  352. {"lottblocks_orc_brick.png"},
  353. "Orc Brick",
  354. "Orc Brick"
  355. )
  356. minetest.register_node("lottblocks:marble_brick", {
  357. description = "Marble Brick",
  358. tiles = {"lottblocks_marble_brick.png"},
  359. is_ground_content = false,
  360. groups = {cracky=2},
  361. sounds = default.node_sound_stone_defaults(),
  362. })
  363. stairs.register_stair_and_slab("marble_brick", "lottblocks:marble_brick",
  364. {cracky=2},
  365. {"lottblocks_marble_brick.png"},
  366. "Marble Brick",
  367. "Marble Brick"
  368. )
  369. minetest.register_craft({
  370. output = 'lottblocks:marble_brick 4',
  371. recipe = {
  372. {'lottores:marble', 'lottores:marble'},
  373. {'lottores:marble', 'lottores:marble'},
  374. }
  375. })
  376. minetest.register_craft({
  377. output = 'lottblocks:orc_brick 4',
  378. recipe = {
  379. {'lottmapgen:mordor_stone', 'lottmapgen:mordor_stone'},
  380. {'lottmapgen:mordor_stone', 'lottmapgen:mordor_stone'},
  381. }
  382. })