nodes.lua 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002
  1. -- LEAVES
  2. minetest.register_node("lottplants:alderleaf", {
  3. description = "Alder Leaf",
  4. drawtype = "allfaces_optional",
  5. visual_scale = 1.3,
  6. tiles = {"lottplants_alderleaf.png"},
  7. paramtype = "light",
  8. waving = 1,
  9. groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
  10. drop = {
  11. max_items = 1,
  12. items = {
  13. {
  14. items = {'lottplants:aldersapling'},
  15. rarity = 20,
  16. },
  17. {
  18. items = {'lottplants:alderleaf'},
  19. }
  20. }
  21. },
  22. sounds = default.node_sound_leaves_defaults(),
  23. })
  24. minetest.register_node("lottplants:appleleaf", {
  25. description = "Apple Leaf",
  26. drawtype = "allfaces_optional",
  27. visual_scale = 1.3,
  28. tiles = {"lottplants_appleleaf.png"},
  29. paramtype = "light",
  30. waving = 1,
  31. groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
  32. drop = {
  33. max_items = 1,
  34. items = {
  35. {
  36. items = {'lottplants:applesapling'},
  37. rarity = 20,
  38. },
  39. {
  40. items = {'lottplants:appleleaf'},
  41. }
  42. }
  43. },
  44. sounds = default.node_sound_leaves_defaults(),
  45. })
  46. minetest.register_node("lottplants:birchleaf", {
  47. description = "Birch Leaf",
  48. drawtype = "allfaces_optional",
  49. visual_scale = 1.3,
  50. tiles = {"lottplants_birchleaf.png"},
  51. paramtype = "light",
  52. waving = 1,
  53. groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
  54. drop = {
  55. max_items = 1,
  56. items = {
  57. {
  58. items = {'lottplants:birchsapling'},
  59. rarity = 20,
  60. },
  61. {
  62. items = {'lottplants:birchleaf'},
  63. }
  64. }
  65. },
  66. sounds = default.node_sound_leaves_defaults(),
  67. })
  68. minetest.register_node("lottplants:beechleaf", {
  69. description = "Beech Leaf",
  70. drawtype = "allfaces_optional",
  71. visual_scale = 1.3,
  72. tiles = {"lottplants_beechleaf.png"},
  73. paramtype = "light",
  74. waving = 1,
  75. groups = {snappy=3, flammable=2},
  76. drop = {
  77. max_items = 1,
  78. items = {
  79. {
  80. items = {'lottplants:beechsapling'},
  81. rarity = 20,
  82. },
  83. {
  84. items = {'lottplants:beechleaf'},
  85. }
  86. }
  87. },
  88. sounds = default.node_sound_leaves_defaults(),
  89. })
  90. minetest.register_node("lottplants:culumaldaleaf", {
  91. description = "Culumalda Leaf",
  92. drawtype = "allfaces_optional",
  93. visual_scale = 1.3,
  94. tiles = {"lottplants_culumaldaleaf.png"},
  95. paramtype = "light",
  96. waving = 1,
  97. groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
  98. drop = {
  99. max_items = 1,
  100. items = {
  101. {
  102. items = {'lottplants:culumaldasapling'},
  103. rarity = 20,
  104. },
  105. {
  106. items = {'lottplants:culumaldaleaf'},
  107. }
  108. }
  109. },
  110. sounds = default.node_sound_leaves_defaults(),
  111. })
  112. minetest.register_node("lottplants:yellowflowers", {
  113. description = "Yellow Flowers on Culumalda Leaf",
  114. drawtype = "allfaces_optional",
  115. visual_scale = 1.3,
  116. tiles = {"lottplants_yellowflowers.png"},
  117. paramtype = "light",
  118. waving = 1,
  119. groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
  120. drop = {
  121. max_items = 3,
  122. items = {
  123. { items = {'lottplants:culumaldaleaf'} },
  124. { items = {'lottplants:culumaldasapling'}, rarity = 20 },
  125. { items = {'lottplants:yellowflowers'} },
  126. }
  127. },
  128. sounds = default.node_sound_leaves_defaults(),
  129. })
  130. minetest.register_node("lottplants:elmleaf", {
  131. description = "Elm Leaf",
  132. drawtype = "allfaces_optional",
  133. visual_scale = 1.3,
  134. tiles = {"lottplants_elmleaf.png"},
  135. paramtype = "light",
  136. waving = 1,
  137. groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
  138. drop = {
  139. max_items = 1,
  140. items = {
  141. {
  142. items = {'lottplants:elmsapling'},
  143. rarity = 20,
  144. },
  145. {
  146. items = {'lottplants:elmleaf'},
  147. }
  148. }
  149. },
  150. sounds = default.node_sound_leaves_defaults(),
  151. })
  152. minetest.register_node("lottplants:firleaf", {
  153. description = "Fir Leaf",
  154. drawtype = "allfaces_optional",
  155. visual_scale = 1.3,
  156. tiles = {"lottplants_firleaf.png"},
  157. paramtype = "light",
  158. waving = 1,
  159. groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
  160. drop = {
  161. max_items = 1,
  162. items = {
  163. {
  164. items = {'lottplants:firsapling'},
  165. rarity = 20,
  166. },
  167. {
  168. items = {'lottplants:firleaf'},
  169. }
  170. }
  171. },
  172. sounds = default.node_sound_leaves_defaults(),
  173. })
  174. minetest.register_node("lottplants:lebethronleaf", {
  175. description = "Lebethron Leaf",
  176. drawtype = "allfaces_optional",
  177. visual_scale = 1.3,
  178. tiles = {"lottplants_lebethronleaf.png"},
  179. paramtype = "light",
  180. waving = 1,
  181. groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
  182. drop = {
  183. max_items = 1,
  184. items = {
  185. {
  186. items = {'lottplants:lebethronsapling'},
  187. rarity = 20,
  188. },
  189. {
  190. items = {'lottplants:lebethronleaf'},
  191. }
  192. }
  193. },
  194. sounds = default.node_sound_leaves_defaults(),
  195. })
  196. minetest.register_node("lottplants:mallornleaf", {
  197. description = "Mallorn Leaf",
  198. drawtype = "allfaces_optional",
  199. visual_scale = 1.3,
  200. tiles = {"lottplants_mallornleaf.png"},
  201. paramtype = "light",
  202. waving = 1,
  203. groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
  204. drop = {
  205. max_items = 1,
  206. items = {
  207. {
  208. items = {'lottplants:mallornsapling'},
  209. rarity = 20,
  210. },
  211. {
  212. items = {'lottplants:mallornleaf'},
  213. }
  214. }
  215. },
  216. sounds = default.node_sound_leaves_defaults(),
  217. })
  218. minetest.register_node("lottplants:pineleaf", {
  219. description = "Pine Needles",
  220. drawtype = "allfaces_optional",
  221. visual_scale = 1.3,
  222. tiles = {"lottplants_pineleaf.png"},
  223. paramtype = "light",
  224. waving = 1,
  225. groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
  226. drop = {
  227. max_items = 1,
  228. items = {
  229. {
  230. items = {'lottplants:pinesapling'},
  231. rarity = 20,
  232. },
  233. {
  234. items = {'lottplants:pineleaf'},
  235. }
  236. }
  237. },
  238. sounds = default.node_sound_leaves_defaults(),
  239. })
  240. minetest.register_node("lottplants:plumleaf", {
  241. description = "Plum Leaf",
  242. drawtype = "allfaces_optional",
  243. visual_scale = 1.3,
  244. tiles = {"lottplants_plumleaf.png"},
  245. paramtype = "light",
  246. waving = 1,
  247. groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
  248. drop = {
  249. max_items = 1,
  250. items = {
  251. {
  252. items = {'lottplants:plumsapling'},
  253. rarity = 20,
  254. },
  255. {
  256. items = {'lottplants:plumleaf'},
  257. }
  258. }
  259. },
  260. sounds = default.node_sound_leaves_defaults(),
  261. })
  262. minetest.register_node("lottplants:rowanleaf", {
  263. description = "Rowan Leaf",
  264. drawtype = "allfaces_optional",
  265. visual_scale = 1.3,
  266. tiles = {"lottplants_rowanleaf.png"},
  267. paramtype = "light",
  268. waving = 1,
  269. groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
  270. drop = {
  271. max_items = 1,
  272. items = {
  273. { items = {'lottplants:rowansapling'}, rarity = 20 },
  274. { items = {'lottfarming:berries'}, rarity = 200 },
  275. { items = {'lottplants:rowanleaf'} },
  276. }
  277. },
  278. sounds = default.node_sound_leaves_defaults(),
  279. })
  280. minetest.register_node("lottplants:rowanberry", {
  281. description = "Rowan Leaf with Berries",
  282. drawtype = "allfaces_optional",
  283. visual_scale = 1.3,
  284. tiles = {"lottplants_rowanleaf.png^lottplants_rowanberry.png"},
  285. paramtype = "light",
  286. waving = 1,
  287. groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
  288. drop = {
  289. max_items = 2,
  290. items = {
  291. { items = {'lottplants:rowanleaf'} },
  292. { items = {'lottfarming:berries'} },
  293. }
  294. },
  295. sounds = default.node_sound_leaves_defaults(),
  296. })
  297. minetest.register_node("lottplants:whiteleaf", {
  298. description = "White Leaf",
  299. drawtype = "allfaces_optional",
  300. visual_scale = 1.3,
  301. tiles = {"lottplants_whiteleaf.png"},
  302. paramtype = "light",
  303. waving = 1,
  304. groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
  305. drop = {
  306. max_items = 1,
  307. items = {
  308. {
  309. items = {'lottplants:whitesapling'},
  310. rarity = 20,
  311. },
  312. {
  313. items = {'lottplants:whiteleaf'},
  314. }
  315. }
  316. },
  317. sounds = default.node_sound_leaves_defaults(),
  318. })
  319. minetest.register_node("lottplants:yavannamireleaf", {
  320. description = "Yavannamire Leaf",
  321. drawtype = "allfaces_optional",
  322. visual_scale = 1.3,
  323. tiles = {"lottplants_yavannamireleaf.png"},
  324. paramtype = "light",
  325. waving = 1,
  326. groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
  327. drop = {
  328. max_items = 1,
  329. items = {
  330. {
  331. items = {'lottplants:yavannamiresapling'},
  332. rarity = 20,
  333. },
  334. {
  335. items = {'lottplants:yavannamireleaf'},
  336. }
  337. }
  338. },
  339. sounds = default.node_sound_leaves_defaults(),
  340. })
  341. minetest.register_alias("lottmapgen:mirkleaves", "lottplants:mirkleaf")
  342. minetest.register_node("lottplants:mirkleaf", {
  343. description = "Mirkwood Leaves",
  344. drawtype = "allfaces_optional",
  345. visual_scale = 1.3,
  346. tiles = {"lottplants_mirkleaf.png"},
  347. paramtype = "light",
  348. sunlight_propagates = false,
  349. waving = 1,
  350. is_ground_content = false,
  351. groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
  352. drop = {
  353. max_items = 1,
  354. items = {
  355. {
  356. items = {'lottplants:mirksapling'},
  357. rarity = 20,
  358. },
  359. {
  360. items = {'lottplants:mirkleaf'},
  361. }
  362. }
  363. },
  364. sounds = default.node_sound_leaves_defaults(),
  365. })
  366. -- TREE
  367. minetest.register_node("lottplants:pinetree", {
  368. description = "Pine Tree",
  369. tiles = {"lottplants_pinetree_top.png", "lottplants_pinetree_top.png", "lottplants_pinetree.png"},
  370. paramtype2 = "facedir",
  371. groups = {tree=1,choppy=3,flammable=2},
  372. sounds = default.node_sound_wood_defaults(),
  373. on_place = minetest.rotate_node,
  374. on_dig = function(pos, node, digger)
  375. default.dig_tree(pos, node, "lottplants:pinetree", digger, 13, 2)
  376. end,
  377. })
  378. minetest.register_node("lottplants:birchtree", {
  379. description = "Birch Tree",
  380. tiles = {"lottplants_birchtree_top.png", "lottplants_birchtree_top.png", "lottplants_birchtree.png"},
  381. paramtype2 = "facedir",
  382. groups = {tree=1,choppy=3,flammable=2},
  383. sounds = default.node_sound_wood_defaults(),
  384. on_place = minetest.rotate_node,
  385. on_dig = function(pos, node, digger)
  386. default.dig_tree(pos, node, "lottplants:birchtree", digger, 12, 3)
  387. end,
  388. })
  389. minetest.register_node("lottplants:aldertree", {
  390. description = "Alder Tree",
  391. tiles = {"lottplants_aldertree_top.png", "lottplants_aldertree_top.png", "lottplants_aldertree.png"},
  392. paramtype2 = "facedir",
  393. groups = {tree=1,choppy=2,flammable=2},
  394. sounds = default.node_sound_wood_defaults(),
  395. on_place = minetest.rotate_node,
  396. on_dig = function(pos, node, digger)
  397. default.dig_tree(pos, node, "lottplants:aldertree", digger, 10, 2)
  398. end,
  399. })
  400. minetest.register_node("lottplants:lebethrontree", {
  401. description = "Lebethron Tree",
  402. tiles = {"lottplants_lebethrontree_top.png", "lottplants_lebethrontree_top.png", "default_tree.png"},
  403. paramtype2 = "facedir",
  404. groups = {tree=1,choppy=1,flammable=2},
  405. sounds = default.node_sound_wood_defaults(),
  406. on_place = minetest.rotate_node,
  407. on_dig = function(pos, node, digger)
  408. default.dig_tree(pos, node, "lottplants:lebethrontree", digger, 10, 2)
  409. end,
  410. })
  411. minetest.register_node("lottplants:mallorntree", {
  412. description = "Mallorn Tree",
  413. tiles = {"lottplants_mallorntree_top.png", "lottplants_mallorntree_top.png", "lottplants_mallorntree.png"},
  414. paramtype2 = "facedir",
  415. groups = {tree=1,choppy=1,flammable=2},
  416. sounds = default.node_sound_wood_defaults(),
  417. on_place = minetest.rotate_node,
  418. on_dig = function(pos, node, digger)
  419. default.dig_tree(pos, node, "lottplants:mallorntree", digger, 30, 5)
  420. end,
  421. })
  422. minetest.register_node("lottplants:mallorntree_young", {
  423. description = "Young Mallorn Trunk",
  424. tiles = {"lottplants_mallorntree_top.png", "lottplants_mallorntree_top.png", "lottplants_mallorntree.png"},
  425. drawtype = "nodebox",
  426. paramtype = "light",
  427. node_box = {
  428. type = "fixed",
  429. fixed = {
  430. {-0.125, -0.5, -0.1875, 0.125, 0.5, 0.1875},
  431. {-0.1875, -0.5, -0.125, 0.1875, 0.5, 0.125},
  432. },
  433. },
  434. paramtype2 = "facedir",
  435. groups = {tree=1,choppy=1,flammable=2,fuel=1},
  436. sounds = default.node_sound_wood_defaults(),
  437. on_place = minetest.rotate_node,
  438. on_dig = function(pos, node, digger)
  439. default.dig_tree(pos, node, "lottplants:mallorntree_young", digger, 10, 1)
  440. end,
  441. })
  442. -- SAPLINGS
  443. minetest.register_node("lottplants:aldersapling", {
  444. description = "Alder Sapling",
  445. drawtype = "plantlike",
  446. visual_scale = 1.0,
  447. tiles = {"lottplants_aldersapling.png"},
  448. inventory_image = "lottplants_aldersapling.png",
  449. wield_image = "lottplants_aldersapling.png",
  450. paramtype = "light",
  451. walkable = false,
  452. groups = {snappy=2,dig_immediate=3,flammable=2,sapling=1},
  453. sounds = default.node_sound_defaults(),
  454. })
  455. minetest.register_node("lottplants:applesapling", {
  456. description = "Apple Tree Sapling",
  457. drawtype = "plantlike",
  458. visual_scale = 1.0,
  459. tiles = {"lottplants_applesapling.png"},
  460. inventory_image = "lottplants_applesapling.png",
  461. wield_image = "lottplants_applesapling.png",
  462. paramtype = "light",
  463. walkable = false,
  464. groups = {snappy=2,dig_immediate=3,flammable=2,sapling=1},
  465. sounds = default.node_sound_defaults(),
  466. })
  467. minetest.register_node("lottplants:birchsapling", {
  468. description = "Birch Sapling",
  469. drawtype = "plantlike",
  470. visual_scale = 1.0,
  471. tiles = {"lottplants_birchsapling.png"},
  472. inventory_image = "lottplants_birchsapling.png",
  473. wield_image = "lottplants_birchsapling.png",
  474. paramtype = "light",
  475. walkable = false,
  476. groups = {snappy=2,dig_immediate=3,flammable=2,sapling=1},
  477. sounds = default.node_sound_defaults(),
  478. })
  479. minetest.register_node("lottplants:beechsapling", {
  480. description = "Beech Sapling",
  481. drawtype = "plantlike",
  482. visual_scale = 1.0,
  483. tiles = {"lottplants_beechsapling.png"},
  484. inventory_image = "lottplants_beechsapling.png",
  485. wield_image = "lottplants_beechsapling.png",
  486. paramtype = "light",
  487. walkable = false,
  488. groups = {snappy=2,dig_immediate=3,flammable=2,sapling=1},
  489. sounds = default.node_sound_defaults(),
  490. })
  491. minetest.register_node("lottplants:culumaldasapling", {
  492. description = "Culumalda Sapling",
  493. drawtype = "plantlike",
  494. visual_scale = 1.0,
  495. tiles = {"lottplants_culumaldasapling.png"},
  496. inventory_image = "lottplants_culumaldasapling.png",
  497. wield_image = "lottplants_culumaldasapling.png",
  498. paramtype = "light",
  499. walkable = false,
  500. groups = {snappy=2,dig_immediate=3,flammable=2,sapling=1},
  501. sounds = default.node_sound_defaults(),
  502. })
  503. minetest.register_node("lottplants:elmsapling", {
  504. description = "Elm Sapling",
  505. drawtype = "plantlike",
  506. visual_scale = 1.0,
  507. tiles = {"lottplants_elmsapling.png"},
  508. inventory_image = "lottplants_elmsapling.png",
  509. wield_image = "lottplants_elmsapling.png",
  510. paramtype = "light",
  511. walkable = false,
  512. groups = {snappy=2,dig_immediate=3,flammable=2,sapling=1},
  513. sounds = default.node_sound_defaults(),
  514. })
  515. minetest.register_node("lottplants:firsapling", {
  516. description = "Fir Sapling",
  517. drawtype = "plantlike",
  518. visual_scale = 1.0,
  519. tiles = {"lottplants_firsapling.png"},
  520. inventory_image = "lottplants_firsapling.png",
  521. wield_image = "lottplants_firsapling.png",
  522. paramtype = "light",
  523. walkable = false,
  524. groups = {snappy=2,dig_immediate=3,flammable=2,sapling=1},
  525. sounds = default.node_sound_defaults(),
  526. })
  527. minetest.register_node("lottplants:lebethronsapling", {
  528. description = "Lebethron Sapling",
  529. drawtype = "plantlike",
  530. visual_scale = 1.0,
  531. tiles = {"lottplants_lebethronsapling.png"},
  532. inventory_image = "lottplants_lebethronsapling.png",
  533. wield_image = "lottplants_lebethronsapling.png",
  534. paramtype = "light",
  535. walkable = false,
  536. groups = {snappy=2,dig_immediate=3,flammable=2,sapling=1},
  537. sounds = default.node_sound_defaults(),
  538. })
  539. minetest.register_node("lottplants:mallornsapling", {
  540. description = "Mallorn Sapling",
  541. drawtype = "plantlike",
  542. visual_scale = 1.0,
  543. tiles = {"lottplants_mallornsapling.png"},
  544. inventory_image = "lottplants_mallornsapling.png",
  545. wield_image = "lottplants_mallornsapling.png",
  546. paramtype = "light",
  547. walkable = false,
  548. groups = {snappy=2,dig_immediate=3,flammable=2,sapling=1},
  549. sounds = default.node_sound_defaults(),
  550. })
  551. minetest.register_node("lottplants:mallorntree_young_grower", {
  552. description = "Young Mallorn Trunk",
  553. tiles = {"lottplants_mallorntree_top.png", "lottplants_mallorntree_top.png", "lottplants_mallorntree.png"},
  554. drawtype = "nodebox",
  555. paramtype = "light",
  556. node_box = {
  557. type = "fixed",
  558. fixed = {
  559. {-0.125, -0.5, -0.1875, 0.125, 0.5, 0.1875},
  560. {-0.1875, -0.5, -0.125, 0.1875, 0.5, 0.125},
  561. },
  562. },
  563. paramtype2 = "facedir",
  564. groups = {tree=1,choppy=1,flammable=2,fuel=1, not_in_creative_inventory=1,sapling=1},
  565. sounds = default.node_sound_wood_defaults(),
  566. drop = "lottplants:mallorntree_young",
  567. on_place = minetest.rotate_node,
  568. on_dig = function(pos, node, digger)
  569. default.dig_tree(pos, node, "lottplants:mallorntree_young", digger, 10, 1)
  570. end,
  571. })
  572. minetest.register_node("lottplants:mallorntree_grower", {
  573. description = "Mallorn Tree",
  574. tiles = {"lottplants_mallorntree_top.png", "lottplants_mallorntree_top.png", "lottplants_mallorntree.png"},
  575. paramtype2 = "facedir",
  576. groups = {tree=1,choppy=1,flammable=2, not_in_creative_inventory=1,sapling=1},
  577. sounds = default.node_sound_wood_defaults(),
  578. drops = "lottplants:mallorntree",
  579. on_place = minetest.rotate_node,
  580. on_dig = function(pos, node, digger)
  581. default.dig_tree(pos, node, "lottplants:mallorntree", digger, 30, 5)
  582. end,
  583. })
  584. minetest.register_node("lottplants:pinesapling", {
  585. description = "Pine Sapling",
  586. drawtype = "plantlike",
  587. visual_scale = 1.0,
  588. tiles = {"lottplants_pinesapling.png"},
  589. inventory_image = "lottplants_pinesapling.png",
  590. wield_image = "lottplants_pinesapling.png",
  591. paramtype = "light",
  592. walkable = false,
  593. groups = {snappy=2,dig_immediate=3,flammable=2,sapling=1},
  594. sounds = default.node_sound_defaults(),
  595. })
  596. minetest.register_node("lottplants:plumsapling", {
  597. description = "Plum Tree Sapling",
  598. drawtype = "plantlike",
  599. visual_scale = 1.0,
  600. tiles = {"lottplants_plumsapling.png"},
  601. inventory_image = "lottplants_plumsapling.png",
  602. wield_image = "lottplants_plumsapling.png",
  603. paramtype = "light",
  604. walkable = false,
  605. groups = {snappy=2,dig_immediate=3,flammable=2,sapling=1},
  606. sounds = default.node_sound_defaults(),
  607. })
  608. minetest.register_node("lottplants:rowansapling", {
  609. description = "Rowan Sapling",
  610. drawtype = "plantlike",
  611. visual_scale = 1.0,
  612. tiles = {"lottplants_rowansapling.png"},
  613. inventory_image = "lottplants_rowansapling.png",
  614. wield_image = "lottplants_rowansapling.png",
  615. paramtype = "light",
  616. walkable = false,
  617. groups = {snappy=2,dig_immediate=3,flammable=2,sapling=1},
  618. sounds = default.node_sound_defaults(),
  619. })
  620. minetest.register_node("lottplants:whitesapling", {
  621. description = "White Tree Sapling",
  622. drawtype = "plantlike",
  623. visual_scale = 1.0,
  624. tiles = {"lottplants_whitesapling.png"},
  625. inventory_image = "lottplants_whitesapling.png",
  626. wield_image = "lottplants_whitesapling.png",
  627. paramtype = "light",
  628. walkable = false,
  629. groups = {snappy=2,dig_immediate=3,flammable=2,sapling=1},
  630. sounds = default.node_sound_defaults(),
  631. })
  632. minetest.register_node("lottplants:yavannamiresapling", {
  633. description = "Yavannamire Sapling",
  634. drawtype = "plantlike",
  635. visual_scale = 1.0,
  636. tiles = {"lottplants_yavannamiresapling.png"},
  637. inventory_image = "lottplants_yavannamiresapling.png",
  638. wield_image = "lottplants_yavannamiresapling.png",
  639. paramtype = "light",
  640. walkable = false,
  641. groups = {snappy=2,dig_immediate=3,flammable=2,sapling=1},
  642. sounds = default.node_sound_defaults(),
  643. })
  644. minetest.register_node("lottplants:mirksapling", {
  645. description = "Mirkwood Sapling",
  646. drawtype = "plantlike",
  647. visual_scale = 1.0,
  648. tiles = {"lottplants_mirksapling.png"},
  649. inventory_image = "lottplants_mirksapling.png",
  650. wield_image = "lottplants_mirksapling.png",
  651. paramtype = "light",
  652. walkable = false,
  653. groups = {snappy=2,dig_immediate=3,flammable=2,sapling=1},
  654. sounds = default.node_sound_defaults(),
  655. })
  656. -- FRUITS
  657. minetest.register_node("lottplants:plum", {
  658. description = "Plum",
  659. drawtype = "plantlike",
  660. visual_scale = 1.0,
  661. tiles = {"lottplants_plum.png"},
  662. inventory_image = "lottplants_plum.png",
  663. paramtype = "light",
  664. sunlight_propagates = true,
  665. walkable = false,
  666. selection_box = {
  667. type = "fixed",
  668. fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2}
  669. },
  670. groups = {fleshy=3,dig_immediate=3,flammable=2,leafdecay=3,leafdecay_drop=1},
  671. on_use = minetest.item_eat(2),
  672. sounds = default.node_sound_leaves_defaults(),
  673. after_place_node = function(pos, placer, itemstack)
  674. if placer:is_player() then
  675. minetest.set_node(pos, {name="lottplants:plum", param2=1})
  676. end
  677. end,
  678. })
  679. minetest.register_node("lottplants:yavannamirefruit", {
  680. description = "Yavannamire Fruit",
  681. drawtype = "plantlike",
  682. visual_scale = 1.0,
  683. tiles = {"lottplants_yavannamirefruit.png"},
  684. inventory_image = "lottplants_yavannamirefruit.png",
  685. paramtype = "light",
  686. sunlight_propagates = true,
  687. walkable = false,
  688. selection_box = {
  689. type = "fixed",
  690. fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2}
  691. },
  692. groups = {fleshy=3,dig_immediate=3,flammable=2,leafdecay=3,leafdecay_drop=1},
  693. on_use = minetest.item_eat(4),
  694. sounds = default.node_sound_leaves_defaults(),
  695. after_place_node = function(pos, placer, itemstack)
  696. if placer:is_player() then
  697. minetest.set_node(pos, {name="lottplants:yavannamirefruit", param2=1})
  698. end
  699. end,
  700. })
  701. --Wood
  702. minetest.register_node("lottplants:pinewood", {
  703. description = "Pine Planks",
  704. tiles = {"lottplants_pinewood.png"},
  705. groups = {choppy=3,flammable=3,wood=1},
  706. sounds = default.node_sound_wood_defaults(),
  707. })
  708. minetest.register_node("lottplants:birchwood", {
  709. description = "Birch Planks",
  710. tiles = {"lottplants_birchwood.png"},
  711. groups = {choppy=3,flammable=3,wood=1},
  712. sounds = default.node_sound_wood_defaults(),
  713. })
  714. minetest.register_node("lottplants:alderwood", {
  715. description = "Alder Planks",
  716. tiles = {"lottplants_alderwood.png"},
  717. groups = {choppy=2,flammable=3,wood=1},
  718. sounds = default.node_sound_wood_defaults(),
  719. })
  720. minetest.register_node("lottplants:lebethronwood", {
  721. description = "Lebethron Planks",
  722. tiles = {"lottplants_lebethronwood.png"},
  723. groups = {choppy=1,flammable=3,wood=1},
  724. sounds = default.node_sound_wood_defaults(),
  725. })
  726. minetest.register_node("lottplants:mallornwood", {
  727. description = "Mallorn Planks",
  728. tiles = {"lottplants_mallornwood.png"},
  729. groups = {choppy=1,flammable=3,wood=1},
  730. sounds = default.node_sound_wood_defaults(),
  731. })
  732. --Lorien grass
  733. minetest.register_node("lottplants:lorien_grass_1", {
  734. description = "Lorien Grass",
  735. drawtype = "plantlike",
  736. tiles = {"lottplants_lorien_grass_1.png"},
  737. -- use a bigger inventory image
  738. inventory_image = "lottplants_lorien_grass_3.png",
  739. wield_image = "lottplants_lorien_grass_3.png",
  740. paramtype = "light",
  741. paramtype2 = "meshoptions",
  742. walkable = false,
  743. waving = 1,
  744. is_ground_content = true,
  745. buildable_to = true,
  746. groups = {snappy=3,flammable=3,flora=1,attached_node=1},
  747. sounds = default.node_sound_leaves_defaults(),
  748. selection_box = {
  749. type = "fixed",
  750. fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
  751. },
  752. on_place = function(itemstack, placer, pointed_thing)
  753. -- place a random grass node
  754. local stack = ItemStack("lottplants:lorien_grass_"..math.random(1,4))
  755. local ret = minetest.item_place(stack, placer, pointed_thing, 40)
  756. return ItemStack("lottplants:lorien_grass_1 "..itemstack:get_count()-(1-ret:get_count()))
  757. end,
  758. })
  759. for i = 2, 4 do
  760. minetest.register_node("lottplants:lorien_grass_" .. i, {
  761. description = "Lorien Grass",
  762. drawtype = "plantlike",
  763. tiles = {"lottplants_lorien_grass_" .. i .. ".png"},
  764. inventory_image = "lottplants_lorien_grass_" .. i .. ".png",
  765. wield_image = "lottplants_lorien_grass_" .. i .. ".png",
  766. paramtype = "light",
  767. paramtype2 = "meshoptions",
  768. walkable = false,
  769. buildable_to = true,
  770. waving = 1,
  771. is_ground_content = true,
  772. drop = "lottplants:lorien_grass_1",
  773. groups = {snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1},
  774. sounds = default.node_sound_leaves_defaults(),
  775. selection_box = {
  776. type = "fixed",
  777. fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
  778. },
  779. })
  780. end
  781. --Stairs & Slabs
  782. stairs.register_stair_and_slab("birchwood", "lottplants:birchwood",
  783. {choppy=3,flammable=3},
  784. {"lottplants_birchwood.png"},
  785. "Birch Wood Stair",
  786. "Birch Wood Slab",
  787. default.node_sound_wood_defaults())
  788. stairs.register_stair_and_slab("birchtree", "lottplants:birchtree",
  789. {choppy=3,flammable=2},
  790. {"lottplants_birchtree_top.png", "lottplants_birchtree_top.png", "lottplants_birchtree.png",
  791. "lottplants_birchtree.png", "lottplants_birchtree.png", "lottplants_birchtree_stair.png"},
  792. "Birch Tree Stair",
  793. "Birch Tree Slab",
  794. default.node_sound_wood_defaults())
  795. stairs.register_stair_and_slab("pinewood", "lottplants:pinewood",
  796. {choppy=3,flammable=3},
  797. {"lottplants_pinewood.png"},
  798. "Pine Wood Stair",
  799. "Pine Wood Slab",
  800. default.node_sound_wood_defaults())
  801. stairs.register_stair_and_slab("pinetree", "lottplants:pinetree",
  802. {choppy=3,flammable=2},
  803. {"lottplants_pinetree_top.png", "lottplants_pinetree_top.png", "lottplants_pinetree.png",
  804. "lottplants_pinetree.png", "lottplants_pinetree.png", "lottplants_pinetree_stair.png"},
  805. "Pine Tree Stair",
  806. "Pine Tree Slab",
  807. default.node_sound_wood_defaults())
  808. stairs.register_stair_and_slab("alderwood", "lottplants:alderwood",
  809. {choppy=2,flammable=3},
  810. {"lottplants_alderwood.png"},
  811. "Alder Wood Stair",
  812. "Alder Wood Slab",
  813. default.node_sound_wood_defaults())
  814. stairs.register_stair_and_slab("aldertree", "lottplants:aldertree",
  815. {choppy=2,flammable=2},
  816. {"lottplants_aldertree_top.png", "lottplants_aldertree_top.png", "lottplants_aldertree.png",
  817. "lottplants_aldertree.png", "lottplants_aldertree.png", "lottplants_aldertree_stair.png"},
  818. "Alder Tree Stair",
  819. "Alder Tree Slab",
  820. default.node_sound_wood_defaults())
  821. stairs.register_stair_and_slab("lebethronwood", "lottplants:lebethronwood",
  822. {choppy=1,flammable=3},
  823. {"lottplants_lebethronwood.png"},
  824. "Lebethron Wood Stair",
  825. "Lebethron Wood Slab",
  826. default.node_sound_wood_defaults())
  827. stairs.register_stair_and_slab("lebethrontree", "lottplants:lebethrontree",
  828. {choppy=1,flammable=2},
  829. {"lottplants_lebethrontree_top.png", "lottplants_lebethrontree_top.png", "default_tree.png",
  830. "default_tree.png", "default_tree.png", "lottplants_lebethrontree_stair.png"},
  831. "Lebethron Tree Stair",
  832. "Lebethron Tree Slab",
  833. default.node_sound_wood_defaults())
  834. stairs.register_stair_and_slab("mallornwood", "lottplants:mallornwood",
  835. {choppy=1,flammable=3},
  836. {"lottplants_mallornwood.png"},
  837. "Mallorn Wood Stair",
  838. "Mallorn Wood Slab",
  839. default.node_sound_wood_defaults())
  840. stairs.register_stair_and_slab("mallorntree", "lottplants:mallorntree",
  841. {choppy=1,flammable=2},
  842. {"lottplants_mallorntree_top.png", "lottplants_mallorntree_top.png", "lottplants_mallorntree.png",
  843. "lottplants_mallorntree.png", "lottplants_mallorntree.png", "lottplants_mallorntree_stair.png"},
  844. "Mallorn Tree Stair",
  845. "Mallorn Tree Slab",
  846. default.node_sound_wood_defaults())
  847. --Crafting
  848. minetest.register_craft({
  849. output = 'lottplants:birchwood 4',
  850. recipe = {
  851. {'lottplants:birchtree'},
  852. }
  853. })
  854. minetest.register_craft({
  855. output = 'lottplants:pinewood 4',
  856. recipe = {
  857. {'lottplants:pinetree'},
  858. }
  859. })
  860. minetest.register_craft({
  861. output = 'lottplants:alderwood 4',
  862. recipe = {
  863. {'lottplants:aldertree'},
  864. }
  865. })
  866. minetest.register_craft({
  867. output = 'lottplants:lebethronwood 4',
  868. recipe = {
  869. {'lottplants:lebethrontree'},
  870. }
  871. })
  872. minetest.register_craft({
  873. output = 'lottplants:mallornwood 4',
  874. recipe = {
  875. {'lottplants:mallorntree'},
  876. }
  877. })
  878. minetest.register_craft({
  879. output = 'lottplants:mallornwood 2',
  880. recipe = {
  881. {'lottplants:mallorntree_young'},
  882. }
  883. })
  884. --Fireflies
  885. minetest.register_node("lottplants:fireflies", {
  886. description = "Fireflies",
  887. drawtype = "glasslike",
  888. tiles = {
  889. {
  890. name = "lottplants_fireflies.png",
  891. animation = {
  892. type = "vertical_frames",
  893. aspect_w = 16,
  894. aspect_h = 16,
  895. length = 2,
  896. },
  897. },
  898. },
  899. alpha = 100,
  900. paramtype = "light",
  901. light_source = 8,
  902. walkable = false,
  903. pointable = true,
  904. diggable = true,
  905. climbable = false,
  906. buildable_to = true,
  907. drop = "",
  908. })
  909. minetest.register_abm({
  910. nodenames = {"air"},
  911. neighbors = {
  912. "lottplants_elanor",
  913. "lottplants:niphredil",
  914. },
  915. interval = 15,
  916. chance = 600,
  917. action = function(pos, node, active_object_count, active_object_count_wider)
  918. if minetest.get_timeofday() > 0.74 or minetest.get_timeofday() < 0.22 then
  919. --local water_nodes = minetest.find_nodes_in_area(minp, maxp, "group:water")
  920. --if #water_nodes > 0 then
  921. if minetest.find_node_near(pos, 3, "lottplants:fireflies") == nil then
  922. minetest.set_node(pos, {name = "lottplants:fireflies"})
  923. end
  924. end
  925. end,
  926. })