init.lua 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166
  1. farming_super = {}
  2. local modpath = minetest.get_modpath("farming_super")
  3. dofile(modpath.."/nodes.lua")
  4. dofile(modpath.."/api.lua")
  5. dofile(modpath.."/vines.lua")
  6. dofile(modpath.."/hops.lua")
  7. dofile(modpath.."/grapes.lua")
  8. dofile(modpath.."/trees.lua")
  9. dofile(modpath.."/durian.lua")
  10. --[[
  11. TODO: crops
  12. artichoke
  13. asparagus
  14. barley
  15. beans
  16. black pepper
  17. broccoli
  18. brussels sprouts
  19. canola
  20. cassava
  21. celery
  22. eggplant
  23. garlic
  24. ginger
  25. green onions on harvesting young onions
  26. hemp
  27. jicama
  28. leeks
  29. lentils
  30. lettuce
  31. mustard
  32. oats
  33. okra
  34. peanuts
  35. peppers
  36. potatoes
  37. rhubarb
  38. rice
  39. sorghum
  40. squash
  41. strawberry
  42. sugar beets
  43. sugarcane
  44. sunflower
  45. sweet potatoes
  46. taro
  47. tomato
  48. turnips
  49. yams
  50. much later:
  51. cucumber -- gourds
  52. grapes
  53. hops
  54. kiwi
  55. lotus
  56. TODO: features
  57. corn oil processing
  58. sugar processing
  59. TODO: core
  60. pests, locusts like butterflies
  61. stick or strings for plants to grow on
  62. wilting on low water
  63. dead version of all plants
  64. yellowing on bad soil
  65. fruit trees
  66. apple, proper
  67. all citrus
  68. pears
  69. durian, jackfruit
  70. fruit flies
  71. rotten fruit on the ground converts dirt
  72. tree hybrids
  73. smudge pots
  74. keep flower level on tree growth
  75. vinegar
  76. scythe for harvesting larger squares
  77. better solution for excessive hoe clicking
  78. drop-in replacement for farming_plus
  79. BUGS:
  80. seed will move to first stage without wet soil
  81. fix on_place to not re-place the same plant and waste inventory
  82. ]]
  83. minetest.register_craftitem("farming_super:corn", {
  84. description = "Corn",
  85. inventory_image = "farming_super_corn.png",
  86. on_use = minetest.item_eat(1),
  87. })
  88. minetest.register_craftitem("farming_super:cooked_corn", {
  89. description = "Cooked Corn",
  90. inventory_image = "farming_super_cooked_corn.png",
  91. on_use = minetest.item_eat(4),
  92. })
  93. minetest.register_craft({
  94. type = "cooking",
  95. cooktime = 10,
  96. output = "farming_super:cooked_corn",
  97. recipe = "farming_super:corn"
  98. })
  99. local corndrop = {
  100. max_items = 6,
  101. items = {
  102. -- { items = {'farming_super:seed_corn'} },
  103. -- { items = {'farming_super:seed_corn'}, rarity = 2},
  104. -- { items = {'farming_super:seed_corn'}, rarity = 3},
  105. { items = {'farming_super:corn 2'} },
  106. { items = {'farming_super:corn'}, rarity = 2 },
  107. { items = {'farming_super:corn'}, rarity = 5 }
  108. }
  109. }
  110. -- todo: extra step where corn dries out and gives no fruit but more seeds
  111. -- regular corn with standard yield
  112. farming_super.register_plant("farming_super:corn", {
  113. description = "Corn",
  114. paramtype2 = "meshoptions",
  115. inventory_image = "farming_super_seed_corn.png",
  116. seed_variants = {
  117. {minNitrogen=15, maxNitrogen=16, name="farming_super:corn_lg"},
  118. {minNitrogen=10, maxNitrogen=14, name="farming_super:corn"},
  119. {minNitrogen=3, maxNitrogen=9, name="farming_super:corn_sm"},
  120. {minNitrogen=0, maxNitrogen=2, name="death"},
  121. },
  122. steps = {3, 2, 2}, -- phases, steps per tier
  123. default_drop = {},
  124. drops = {
  125. p3s2t2 = corndrop, -- phase 3, step 2, tier 2
  126. },
  127. textures = { -- overrides default texture naming, allowing reuse
  128. p2s1t2 = "farming_super_corn_1_1_1.png",
  129. p2s2t1 = "farming_super_corn_2_1_1.png",
  130. p2s2t2 = "farming_super_corn_1_3_1.png",
  131. p3s1t1 = "farming_super_corn_2_1_1.png",
  132. p3s1t2 = "farming_super_corn_2_1_1.png",
  133. p3s1t3 = "farming_super_corn_1_2_1.png",
  134. p3s2t1 = "farming_super_corn_2_1_1.png",
  135. p3s2t2 = "farming_super_corn_4_2_2.png",
  136. p3s2t3 = "farming_super_corn_4_2_4.png",
  137. },
  138. minlight = 13,
  139. maxlight = 15,
  140. fertility = {"grassland"},
  141. groups = {flammable = 4, use_nitrogen = 2},
  142. place_param2 = 2,
  143. })
  144. -- smaller corn with less yield
  145. farming_super.register_plant("farming_super:corn_sm", {
  146. description = "Corn",
  147. paramtype2 = "meshoptions",
  148. inventory_image = "farming_super_seed_corn.png",
  149. steps = {3, 4}, -- phases, steps per tier
  150. default_drop = {},
  151. no_seed = true, -- seeds and harvests are already registered
  152. no_harvest = true,
  153. drops = {
  154. p2s4t1 = {
  155. max_items = 4,
  156. items = {
  157. -- { items = {'farming_super:seed_corn'} },
  158. -- { items = {'farming_super:seed_corn'}, rarity = 5},
  159. { items = {'farming_super:corn '} },
  160. { items = {'farming_super:corn'}, rarity = 5 }
  161. }
  162. }, -- phase 3, step 2, tier 2
  163. },
  164. textures = { -- overrides default texture naming, allowing reuse
  165. base = "farming_super_corn",
  166. p2s1t2 = "farming_super_corn_1_1_1.png",
  167. p2s2t1 = "farming_super_corn_2_1_1.png",
  168. p2s2t2 = "farming_super_corn_1_2_1.png",
  169. p2s3t1 = "farming_super_corn_2_1_1.png",
  170. p2s3t2 = "farming_super_corn_1_3_1.png",
  171. p2s4t1 = "farming_super_corn_4_2_2.png",
  172. p2s4t2 = "farming_super_corn_4_2_4.png",
  173. },
  174. minlight = 13,
  175. maxlight = 15,
  176. fertility = {"grassland"},
  177. groups = {flammable = 4, use_nitrogen = 1},
  178. place_param2 = 2,
  179. })
  180. -- large corn with large yield
  181. farming_super.register_plant("farming_super:corn_lg", {
  182. description = "Corn",
  183. paramtype2 = "meshoptions",
  184. inventory_image = "farming_super_seed_corn.png",
  185. steps = {3, 1, 1, 2}, -- phases, steps per tier
  186. default_drop = {},
  187. no_seed = true, -- seeds and harvests are already registered
  188. no_harvest = true,
  189. drops = {
  190. p4s2t2 = corndrop, -- phase 4, step 2, tier 2
  191. p4s2t3 = corndrop,
  192. },
  193. textures = { -- overrides default texture naming, allowing reuse
  194. base = "farming_super_corn",
  195. p2s1t2 = "farming_super_corn_1_2_1.png",
  196. p3s1t1 = "farming_super_corn_2_1_1.png",
  197. p3s1t2 = "farming_super_corn_2_1_1.png",
  198. p3s1t3 = "farming_super_corn_1_2_1.png",
  199. p4s1t1 = "farming_super_corn_2_1_1.png",
  200. p4s1t2 = "farming_super_corn_2_1_1.png",
  201. p4s1t3 = "farming_super_corn_2_1_1.png",
  202. p4s1t4 = "farming_super_corn_1_2_1.png",
  203. p4s2t1 = "farming_super_corn_2_1_1.png",
  204. p4s2t3 = "farming_super_corn_4_2_2.png",
  205. },
  206. minlight = 13,
  207. maxlight = 15,
  208. fertility = {"grassland"},
  209. groups = {flammable = 4, use_nitrogen = 3},
  210. place_param2 = 2,
  211. })
  212. minetest.register_decoration({
  213. name = "farming_super:corn_sm",
  214. deco_type = "schematic",
  215. place_on = {"default:dry_dirt_with_dry_grass", "default:dry_dirt", "default:dirt_with_grass"},
  216. sidelen = 16,
  217. noise_params = {
  218. offset = 0.0003,
  219. scale = 0.0009,
  220. spread = {x = 200, y = 200, z = 200},
  221. seed = 7512,
  222. octaves = 3,
  223. persist = 0.6
  224. },
  225. biomes = {"savanna", "grassland"},
  226. y_max = 128,
  227. y_min = 5,
  228. place_offset_y = 1,
  229. schematic = {
  230. size = {x = 1, y = 2, z = 1},
  231. data = {
  232. {name = "farming_super:corn_sm_7_1", param2 = 2},
  233. {name = "farming_super:corn_sm_7_2", param2 = 2},
  234. },
  235. },
  236. param2 = 2,
  237. flags = "force_placement", -- make sure the lower part isn't missing because of a prior decoration
  238. })
  239. minetest.register_craft({
  240. output = "farming_super:seed_corn 10",
  241. type = "shapeless",
  242. recipe = {"farming_super:corn"},
  243. })
  244. -- standard soybeans
  245. farming_super.register_plant("farming_super:soybeans", {
  246. description = "Soybeans",
  247. paramtype2 = "meshoptions",
  248. place_param2 = "X",
  249. inventory_image = "farming_super_seed_soybeans.png",
  250. steps = {5}, -- phases, steps per tier
  251. default_drop = {},
  252. drops = {
  253. p1s5t1 = {
  254. max_items = 5,
  255. items = {
  256. { items = {'farming_super:seed_soybeans'} },
  257. { items = {'farming_super:seed_soybeans'}, rarity = 2},
  258. { items = {'farming_super:seed_soybeans'}, rarity = 5},
  259. { items = {'farming_super:soybeans 2'} },
  260. { items = {'farming_super:soybeans'}, rarity = 3 }
  261. }
  262. },
  263. },
  264. minlight = 13,
  265. maxlight = 15,
  266. fertility = {"grassland"},
  267. groups = {flammable = 4, fix_nitrogen = 2},
  268. })
  269. farming_super.register_plant("farming_super:onion_yellow", {
  270. description = "Yellow Onion",
  271. paramtype2 = "meshoptions",
  272. place_param2 = "hatch",
  273. inventory_image = "farming_super_seed_yellow_onion.png",
  274. steps = {4}, -- phases, steps per tier
  275. step_len = {1, 2, 3, 4},
  276. default_drop = {},
  277. drops = {
  278. p1s4t1 = {
  279. max_items = 4,
  280. items = {
  281. { items = {'farming_super:seed_onion_yellow'} },
  282. { items = {'farming_super:seed_onion_yellow'}, rarity = 2},
  283. { items = {'farming_super:seed_onion_yellow'}, rarity = 5},
  284. { items = {'farming_super:onion_yellow'} },
  285. }
  286. },
  287. },
  288. textures = { -- overrides default texture naming, allowing reuse
  289. base = "farming_super_onion",
  290. p1s4t1 = "farming_super_onion_yellow_1_4_1.png",
  291. },
  292. minlight = 13,
  293. maxlight = 15,
  294. fertility = {"grassland"},
  295. groups = {flammable = 4},
  296. })
  297. farming_super.register_plant("farming_super:onion_white", {
  298. description = "White Onion",
  299. paramtype2 = "meshoptions",
  300. place_param2 = "#",
  301. inventory_image = "farming_super_seed_white_onion.png",
  302. steps = {4}, -- phases, steps per tier
  303. step_len = {1, 2, 3, 4},
  304. default_drop = {},
  305. drops = {
  306. p1s4t1 = {
  307. max_items = 4,
  308. items = {
  309. { items = {'farming_super:seed_onion_white'} },
  310. { items = {'farming_super:seed_onion_white'}, rarity = 2},
  311. { items = {'farming_super:seed_onion_white'}, rarity = 5},
  312. { items = {'farming_super:onion_white'} },
  313. }
  314. },
  315. },
  316. textures = { -- overrides default texture naming, allowing reuse
  317. base = "farming_super_onion",
  318. p1s4t1 = "farming_super_onion_white_1_4_1.png",
  319. },
  320. minlight = 13,
  321. maxlight = 15,
  322. fertility = {"grassland"},
  323. groups = {flammable = 4},
  324. })
  325. farming_super.register_plant("farming_super:onion_red", {
  326. description = "Red Onion",
  327. paramtype2 = "meshoptions",
  328. place_param2 = "#",
  329. inventory_image = "farming_super_seed_red_onion.png",
  330. steps = {4}, -- phases, steps per tier
  331. step_len = {1, 2, 3, 4},
  332. default_drop = {},
  333. drops = {
  334. p1s4t1 = {
  335. max_items = 4,
  336. items = {
  337. { items = {'farming_super:seed_onion_red'} },
  338. { items = {'farming_super:seed_onion_red'}, rarity = 2},
  339. { items = {'farming_super:seed_onion_red'}, rarity = 5},
  340. { items = {'farming_super:onion_red'} },
  341. }
  342. },
  343. },
  344. textures = { -- overrides default texture naming, allowing reuse
  345. base = "farming_super_onion",
  346. p1s4t1 = "farming_super_onion_red_1_4_1.png",
  347. },
  348. minlight = 13,
  349. maxlight = 15,
  350. fertility = {"grassland"},
  351. groups = {flammable = 4},
  352. })
  353. minetest.register_decoration({
  354. name = "farming_super:onion_5_1",
  355. deco_type = "simple",
  356. place_on = {"default:dry_dirt_with_dry_grass", "default:dry_dirt"},
  357. sidelen = 16,
  358. noise_params = {
  359. offset = -0.0002,
  360. scale = 0.0009,
  361. spread = {x = 200, y = 200, z = 200},
  362. seed = 2248,
  363. octaves = 3,
  364. persist = 0.6
  365. },
  366. biomes = {"savanna",},
  367. y_max = 128,
  368. y_min = 5,
  369. decoration = {
  370. "farming_super:onion_red_4_1",
  371. "farming_super:onion_white_4_1",
  372. "farming_super:onion_yellow_4_1",
  373. },
  374. param2 = 3,
  375. })
  376. local function place_pineapple(itemstack, placer, pointedthing)
  377. local above = pointedthing.above
  378. local under = pointedthing.under
  379. local soil = minetest.get_node_or_nil(under)
  380. if not soil then
  381. return itemstack
  382. end
  383. if minetest.get_item_group(soil.name, "wet") < 1 then
  384. return itemstack
  385. end
  386. if minetest.get_item_group(soil.name, "desert") < 1 then
  387. return itemstack
  388. end
  389. minetest.set_node(above, {name="farming_super:pineapple_1_1", param2=2 })
  390. farming_super.tick_node(above, 1)
  391. itemstack:take_item(1)
  392. return itemstack
  393. end
  394. minetest.register_craftitem("farming_super:pineapple_sucker", {
  395. description = "Pineapple Sucker",
  396. inventory_image = "farming_super_pineapple_sucker.png",
  397. on_place = place_pineapple,
  398. })
  399. minetest.register_craftitem("farming_super:pineapple_top", {
  400. description = "Pineapple Top",
  401. inventory_image = "farming_super_pineapple_top.png",
  402. on_place = place_pineapple,
  403. })
  404. minetest.register_craftitem("farming_super:pineapple", {
  405. description = "Pineapple",
  406. inventory_image = "farming_super_pineapple.png",
  407. on_use = minetest.item_eat(6, "farming_super:pineapple_top"),
  408. })
  409. farming_super.register_plant("farming_super:pineapple", {
  410. description = "Pineapple",
  411. paramtype2 = "meshoptions",
  412. place_param2 = "hex",
  413. inventory_image = "farming_super_pineapple_top.png",
  414. steps = {5}, -- phases, steps per tier
  415. default_drop = {},
  416. no_seed = true, -- pineapples don't have seeds in practice
  417. no_harvest = true, -- defined above for special behavior
  418. drops = {
  419. p1s5t1 = {
  420. max_items = 2,
  421. items = {
  422. { items = {'farming_super:pineapple'} },
  423. { items = {'farming_super:pineapple_sucker'}, rarity = 4 },
  424. }
  425. },
  426. },
  427. minlight = 13,
  428. maxlight = 15,
  429. fertility = {"desert"},
  430. groups = {flammable = 4},
  431. })
  432. minetest.register_decoration({
  433. name = "farming_super:pineapple_5_1",
  434. deco_type = "simple",
  435. place_on = {"default:desert_sand", "default:sand"},
  436. sidelen = 16,
  437. noise_params = {
  438. offset = -0.0003,
  439. scale = 0.0009,
  440. spread = {x = 200, y = 200, z = 200},
  441. seed = 3456,
  442. octaves = 3,
  443. persist = 0.6
  444. },
  445. biomes = {"desert", "sandstone_desert", "desert_ocean"},
  446. y_max = 6,
  447. y_min = 0,
  448. decoration = "farming_super:pineapple_5_1",
  449. param2 = 2,
  450. })
  451. -- standard soybeans
  452. farming_super.register_plant("farming_super:soybeans", {
  453. description = "Soybeans",
  454. paramtype2 = "meshoptions",
  455. place_param2 = "X",
  456. inventory_image = "farming_super_seed_soybeans.png",
  457. -- visual_scale = 1.3,
  458. step_len = {1, 2, 2, 2},
  459. steps = {5}, -- phases, steps per tier
  460. default_drop = {},
  461. drops = {
  462. p1s5t1 = {
  463. max_items = 3,
  464. items = {
  465. { items = {'farming_super:soybeans 2'} },
  466. { items = {'farming_super:soybeans'}, rarity = 3 },
  467. { items = {'farming_super:soybeans'}, rarity = 5 },
  468. }
  469. },
  470. },
  471. minlight = 13,
  472. maxlight = 15,
  473. fertility = {"grassland"},
  474. groups = {flammable = 4, fix_nitrogen = 1},
  475. })
  476. minetest.register_craft({
  477. output = "farming_super:seed_soybeans 3",
  478. type = "shapeless",
  479. recipe = {"farming_super:soybeans"},
  480. })
  481. minetest.register_decoration({
  482. name = "farming_super:soybeans_5_1",
  483. deco_type = "simple",
  484. place_on = {"default:dirt_with_grass",},
  485. sidelen = 16,
  486. noise_params = {
  487. offset = -0.0003,
  488. scale = 0.0009,
  489. spread = {x = 200, y = 200, z = 200},
  490. seed = 9764,
  491. octaves = 3,
  492. persist = 0.6
  493. },
  494. biomes = {"grassland",},
  495. y_max = 128,
  496. y_min = 5,
  497. decoration = "farming_super:soybeans_5_1",
  498. param2 = 0,
  499. })
  500. -- standard cabbage
  501. farming_super.register_plant("farming_super:cabbage", {
  502. description = "Cabbage",
  503. paramtype2 = "meshoptions",
  504. place_param2 = "X",
  505. inventory_image = "farming_super_seed_cabbage.png",
  506. -- visual_scale = 1.3,
  507. steps = {4}, -- phases, steps per tier
  508. step_len = {1, 1, 2, 2},
  509. textures = { -- overrides default texture naming, allowing reuse
  510. p1s1t1 = "farming_super_green_pixels_1.png",
  511. p1s2t1 = "farming_super_green_pixels_2.png",
  512. p1s3t1 = "farming_super_cabbage_3.png",
  513. p1s4t1 = "farming_super_cabbage_4.png",
  514. },
  515. default_drop = {},
  516. drops = {
  517. p1s4t1 = {
  518. max_items = 4,
  519. items = {
  520. { items = {'farming_super:seed_cabbage'} },
  521. { items = {'farming_super:seed_cabbage'}, rarity = 2},
  522. { items = {'farming_super:seed_cabbage'}, rarity = 5},
  523. { items = {'farming_super:cabbage'} },
  524. }
  525. },
  526. },
  527. minlight = 10,
  528. maxlight = 15,
  529. fertility = {"grassland"},
  530. groups = {flammable = 4, },
  531. })
  532. minetest.register_decoration({
  533. name = "farming_super:cabbage_4_1",
  534. deco_type = "simple",
  535. place_on = {"default:dirt_with_rainforest_litter",},
  536. sidelen = 16,
  537. noise_params = {
  538. offset = 0.0003,
  539. scale = 0.0009,
  540. spread = {x = 200, y = 200, z = 200},
  541. seed = 5278,
  542. octaves = 3,
  543. persist = 0.6
  544. },
  545. biomes = {"jungle",},
  546. y_max = 30,
  547. y_min = 1,
  548. decoration = "farming_super:cabbage_4_1",
  549. param2 = 0,
  550. })
  551. -- standard cauliflower
  552. farming_super.register_plant("farming_super:cauliflower", {
  553. description = "Cauliflower",
  554. paramtype2 = "meshoptions",
  555. place_param2 = "X",
  556. inventory_image = "farming_super_seed_cauliflower.png",
  557. -- visual_scale = 1.3,
  558. steps = {4}, -- phases, steps per tier
  559. step_len = {1, 1, 2, 2},
  560. textures = { -- overrides default texture naming, allowing reuse
  561. p1s1t1 = "farming_super_green_pixels_1.png",
  562. p1s2t1 = "farming_super_green_pixels_2.png",
  563. p1s3t1 = "farming_super_cabbage_3.png",
  564. p1s4t1 = "farming_super_cauliflower_4.png",
  565. },
  566. default_drop = {},
  567. drops = {
  568. p1s4t1 = {
  569. max_items = 4,
  570. items = {
  571. { items = {'farming_super:seed_cauliflower'} },
  572. { items = {'farming_super:seed_cauliflower'}, rarity = 2},
  573. { items = {'farming_super:seed_cauliflower'}, rarity = 5},
  574. { items = {'farming_super:cauliflower'} },
  575. }
  576. },
  577. },
  578. minlight = 10,
  579. maxlight = 15,
  580. fertility = {"grassland"},
  581. groups = {flammable = 4, },
  582. })
  583. minetest.register_decoration({
  584. name = "farming_super:cauliflower_4_1",
  585. deco_type = "simple",
  586. place_on = {"default:dirt_with_rainforest_litter",},
  587. sidelen = 16,
  588. noise_params = {
  589. offset = 0.0003,
  590. scale = 0.0009,
  591. spread = {x = 200, y = 200, z = 200},
  592. seed = 8743,
  593. octaves = 3,
  594. persist = 0.6
  595. },
  596. biomes = {"jungle",},
  597. y_max = 30,
  598. y_min = 1,
  599. decoration = "farming_super:cauliflower_4_1",
  600. param2 = 0,
  601. })
  602. -- standard radish
  603. farming_super.register_plant("farming_super:radish", {
  604. description = "Radish",
  605. paramtype2 = "meshoptions",
  606. place_param2 = "hatch",
  607. inventory_image = "farming_super_seed_radish.png",
  608. -- visual_scale = 1.3,
  609. eat_value = 1,
  610. steps = {4}, -- phases, steps per tier
  611. step_len = {1, 2, 2, 2},
  612. textures = { -- overrides default texture naming, allowing reuse
  613. p1s1t1 = "farming_super_2x_green_pixels_1.png",
  614. p1s2t1 = "farming_super_2x_green_pixels_2.png",
  615. p1s3t1 = "farming_super_radish_3.png",
  616. p1s4t1 = "farming_super_radish_4.png",
  617. },
  618. default_drop = {},
  619. drops = {
  620. p1s4t1 = {
  621. max_items = 4,
  622. items = {
  623. { items = {'farming_super:seed_radish'} },
  624. { items = {'farming_super:seed_radish'}, rarity = 2},
  625. { items = {'farming_super:seed_radish'}, rarity = 5},
  626. { items = {'farming_super:radish 4'} },
  627. }
  628. },
  629. },
  630. minlight = 10,
  631. maxlight = 15,
  632. fertility = {"grassland"},
  633. groups = {flammable = 4, },
  634. })
  635. minetest.register_decoration({
  636. name = "farming_super:radish_4_1",
  637. deco_type = "simple",
  638. place_on = {"default:dirt_with_coniferous_litter",},
  639. sidelen = 16,
  640. noise_params = {
  641. offset = 0.0003,
  642. scale = 0.0009,
  643. spread = {x = 200, y = 200, z = 200},
  644. seed = 4782,
  645. octaves = 3,
  646. persist = 0.6
  647. },
  648. biomes = {"coniferous_forest", },
  649. y_max = 30,
  650. y_min = 1,
  651. decoration = "farming_super:radish_4_1",
  652. param2 = 3,
  653. })
  654. -- standard daikon
  655. farming_super.register_plant("farming_super:daikon", {
  656. description = "Daikon",
  657. paramtype2 = "meshoptions",
  658. place_param2 = "V",
  659. inventory_image = "farming_super_seed_daikon.png",
  660. -- visual_scale = 1.3,
  661. eat_value = 4,
  662. steps = {4}, -- phases, steps per tier
  663. step_len = {1, 2, 2, 2},
  664. textures = { -- overrides default texture naming, allowing reuse
  665. p1s1t1 = "farming_super_green_pixels_1.png",
  666. p1s2t1 = "farming_super_green_pixels_2.png",
  667. p1s3t1 = "farming_super_daikon_3.png",
  668. p1s4t1 = "farming_super_daikon_4.png",
  669. },
  670. default_drop = {},
  671. drops = {
  672. p1s4t1 = {
  673. max_items = 4,
  674. items = {
  675. { items = {'farming_super:seed_daikon 2'} },
  676. { items = {'farming_super:seed_daikon'}, rarity = 2},
  677. { items = {'farming_super:seed_daikon 2'}, rarity = 5},
  678. { items = {'farming_super:daikon 1'} },
  679. }
  680. },
  681. },
  682. minlight = 10,
  683. maxlight = 15,
  684. fertility = {"grassland"},
  685. groups = {flammable = 4, },
  686. })
  687. minetest.register_decoration({
  688. name = "farming_super:daikon_4_1",
  689. deco_type = "simple",
  690. place_on = {"default:dirt_with_jungle_litter",},
  691. sidelen = 16,
  692. noise_params = {
  693. offset = 0.0003,
  694. scale = 0.0009,
  695. spread = {x = 200, y = 200, z = 200},
  696. seed = 7362,
  697. octaves = 3,
  698. persist = 0.6
  699. },
  700. biomes = {"jungle", },
  701. y_max = 30,
  702. y_min = 1,
  703. decoration = "farming_super:daikon_4_1",
  704. param2 = 4,
  705. })
  706. -- standard beet
  707. farming_super.register_plant("farming_super:beet", {
  708. description = "Beet",
  709. paramtype2 = "meshoptions",
  710. place_param2 = "#",
  711. inventory_image = "farming_super_seed_beet.png",
  712. -- visual_scale = 1.3,
  713. eat_value = 2,
  714. steps = {4}, -- phases, steps per tier
  715. step_len = {1, 2, 2, 2},
  716. textures = { -- overrides default texture naming, allowing reuse
  717. p1s1t1 = "farming_super_2x_green_pixels_1.png",
  718. p1s2t1 = "farming_super_2x_green_pixels_2.png",
  719. p1s3t1 = "farming_super_beet_3.png",
  720. p1s4t1 = "farming_super_beet_4.png",
  721. },
  722. default_drop = {},
  723. drops = {
  724. p1s4t1 = {
  725. max_items = 3,
  726. items = {
  727. { items = {'farming_super:seed_beet'} },
  728. { items = {'farming_super:seed_beet'}, rarity = 2},
  729. { items = {'farming_super:seed_beet'}, rarity = 5},
  730. { items = {'farming_super:beet 4'} },
  731. }
  732. },
  733. },
  734. minlight = 10,
  735. maxlight = 15,
  736. fertility = {"grassland"},
  737. groups = {flammable = 4, },
  738. })
  739. minetest.register_decoration({
  740. name = "farming_super:beet_4_1",
  741. deco_type = "simple",
  742. place_on = {"default:dirt_with_grass",},
  743. sidelen = 16,
  744. noise_params = {
  745. offset = -0.0003,
  746. scale = 0.0009,
  747. spread = {x = 200, y = 200, z = 200},
  748. seed = 8421,
  749. octaves = 3,
  750. persist = 0.6
  751. },
  752. biomes = {"grassland", },
  753. y_max = 70,
  754. y_min = 1,
  755. decoration = "farming_super:beet_4_1",
  756. param2 = 3,
  757. })
  758. -- standard carrot
  759. farming_super.register_plant("farming_super:carrot", {
  760. description = "Carrot",
  761. paramtype2 = "meshoptions",
  762. place_param2 = "#",
  763. inventory_image = "farming_super_seed_carrot.png",
  764. -- visual_scale = 1.3,
  765. eat_value = 2,
  766. steps = {4}, -- phases, steps per tier
  767. step_len = {1, 2, 3, 3},
  768. textures = { -- overrides default texture naming, allowing reuse
  769. p1s1t1 = "farming_super_2x_green_pixels_1.png",
  770. p1s2t1 = "farming_super_2x_green_pixels_2.png",
  771. p1s3t1 = "farming_super_carrot_3.png",
  772. p1s4t1 = "farming_super_carrot_4.png",
  773. },
  774. default_drop = {},
  775. drops = {
  776. p1s4t1 = {
  777. max_items = 3,
  778. items = {
  779. { items = {'farming_super:seed_carrot'} },
  780. { items = {'farming_super:seed_carrot'}, rarity = 2},
  781. { items = {'farming_super:seed_carrot'}, rarity = 5},
  782. { items = {'farming_super:carrot 4'} },
  783. }
  784. },
  785. },
  786. minlight = 10,
  787. maxlight = 15,
  788. fertility = {"grassland"},
  789. groups = {flammable = 4, },
  790. })
  791. minetest.register_decoration({
  792. name = "farming_super:carrot_4_1",
  793. deco_type = "simple",
  794. place_on = {"default:dirt_with_grass",},
  795. sidelen = 16,
  796. noise_params = {
  797. offset = -0.0003,
  798. scale = 0.0009,
  799. spread = {x = 200, y = 200, z = 200},
  800. seed = 2679,
  801. octaves = 3,
  802. persist = 0.6
  803. },
  804. biomes = {"grassland", },
  805. y_max = 70,
  806. y_min = 1,
  807. decoration = "farming_super:carrot_4_1",
  808. param2 = 3,
  809. })
  810. -- standard carrot_red
  811. farming_super.register_plant("farming_super:carrot_red", {
  812. description = "Carrot, Red",
  813. paramtype2 = "meshoptions",
  814. place_param2 = "#",
  815. inventory_image = "farming_super_seed_carrot.png",
  816. -- visual_scale = 1.3,
  817. eat_value = 2,
  818. steps = {4}, -- phases, steps per tier
  819. step_len = {1, 2, 3, 3},
  820. textures = { -- overrides default texture naming, allowing reuse
  821. p1s1t1 = "farming_super_2x_green_pixels_1.png",
  822. p1s2t1 = "farming_super_2x_green_pixels_2.png",
  823. p1s3t1 = "farming_super_carrot_3.png",
  824. p1s4t1 = "farming_super_carrot_red_4.png",
  825. },
  826. default_drop = {},
  827. drops = {
  828. p1s4t1 = {
  829. max_items = 3,
  830. items = {
  831. { items = {'farming_super:seed_carrot_red'} },
  832. { items = {'farming_super:seed_carrot_red'}, rarity = 2},
  833. { items = {'farming_super:seed_carrot_red'}, rarity = 5},
  834. { items = {'farming_super:carrot_red 4'} },
  835. }
  836. },
  837. },
  838. minlight = 10,
  839. maxlight = 15,
  840. fertility = {"grassland"},
  841. groups = {flammable = 4, },
  842. })
  843. minetest.register_decoration({
  844. name = "farming_super:carrot_red_4_1",
  845. deco_type = "simple",
  846. place_on = {"default:dirt_with_grass",},
  847. sidelen = 16,
  848. noise_params = {
  849. offset = -0.0003,
  850. scale = 0.0009,
  851. spread = {x = 200, y = 200, z = 200},
  852. seed = 8432,
  853. octaves = 3,
  854. persist = 0.6
  855. },
  856. biomes = {"grassland", },
  857. y_max = 70,
  858. y_min = 1,
  859. decoration = "farming_super:carrot_red_4_1",
  860. param2 = 3,
  861. })
  862. -- standard carrot_yellow
  863. farming_super.register_plant("farming_super:carrot_yellow", {
  864. description = "Carrot, Yellow",
  865. paramtype2 = "meshoptions",
  866. place_param2 = "#",
  867. inventory_image = "farming_super_seed_carrot.png",
  868. -- visual_scale = 1.3,
  869. eat_value = 2,
  870. steps = {4}, -- phases, steps per tier
  871. step_len = {1, 2, 3, 3},
  872. textures = { -- overrides default texture naming, allowing reuse
  873. p1s1t1 = "farming_super_2x_green_pixels_1.png",
  874. p1s2t1 = "farming_super_2x_green_pixels_2.png",
  875. p1s3t1 = "farming_super_carrot_3.png",
  876. p1s4t1 = "farming_super_carrot_yellow_4.png",
  877. },
  878. default_drop = {},
  879. drops = {
  880. p1s4t1 = {
  881. max_items = 3,
  882. items = {
  883. { items = {'farming_super:seed_carrot_yellow'} },
  884. { items = {'farming_super:seed_carrot_yellow'}, rarity = 2},
  885. { items = {'farming_super:seed_carrot_yellow'}, rarity = 5},
  886. { items = {'farming_super:carrot_yellow 4'} },
  887. }
  888. },
  889. },
  890. minlight = 10,
  891. maxlight = 15,
  892. fertility = {"grassland"},
  893. groups = {flammable = 4, },
  894. })
  895. minetest.register_decoration({
  896. name = "farming_super:carrot_yellow_4_1",
  897. deco_type = "simple",
  898. place_on = {"default:dirt_with_grass",},
  899. sidelen = 16,
  900. noise_params = {
  901. offset = -0.0003,
  902. scale = 0.0009,
  903. spread = {x = 200, y = 200, z = 200},
  904. seed = 1437,
  905. octaves = 3,
  906. persist = 0.6
  907. },
  908. biomes = {"grassland", },
  909. y_max = 70,
  910. y_min = 1,
  911. decoration = "farming_super:carrot_yellow_4_1",
  912. param2 = 3,
  913. })
  914. -- standard carrot_purple
  915. farming_super.register_plant("farming_super:carrot_purple", {
  916. description = "Carrot, Purple",
  917. paramtype2 = "meshoptions",
  918. place_param2 = "#",
  919. inventory_image = "farming_super_seed_carrot.png",
  920. -- visual_scale = 1.3,
  921. eat_value = 2,
  922. steps = {4}, -- phases, steps per tier
  923. step_len = {1, 2, 3, 3},
  924. textures = { -- overrides default texture naming, allowing reuse
  925. p1s1t1 = "farming_super_2x_green_pixels_1.png",
  926. p1s2t1 = "farming_super_2x_green_pixels_2.png",
  927. p1s3t1 = "farming_super_carrot_3.png",
  928. p1s4t1 = "farming_super_carrot_purple_4.png",
  929. },
  930. default_drop = {},
  931. drops = {
  932. p1s4t1 = {
  933. max_items = 3,
  934. items = {
  935. { items = {'farming_super:seed_carrot_purple'} },
  936. { items = {'farming_super:seed_carrot_purple'}, rarity = 2},
  937. { items = {'farming_super:seed_carrot_purple'}, rarity = 5},
  938. { items = {'farming_super:carrot_purple 4'} },
  939. }
  940. },
  941. },
  942. minlight = 10,
  943. maxlight = 15,
  944. fertility = {"grassland"},
  945. groups = {flammable = 4, },
  946. })
  947. minetest.register_decoration({
  948. name = "farming_super:carrot_purple_4_1",
  949. deco_type = "simple",
  950. place_on = {"default:dirt_with_grass",},
  951. sidelen = 16,
  952. noise_params = {
  953. offset = -0.0003,
  954. scale = 0.0009,
  955. spread = {x = 200, y = 200, z = 200},
  956. seed = 9978,
  957. octaves = 3,
  958. persist = 0.6
  959. },
  960. biomes = {"grassland", },
  961. y_max = 70,
  962. y_min = 1,
  963. decoration = "farming_super:carrot_purple_4_1",
  964. param2 = 3,
  965. })
  966. -- rice
  967. farming_super.register_plant("farming_super:rice", {
  968. description = "Rice",
  969. paramtype2 = "meshoptions",
  970. place_param2 = "#",
  971. inventory_image = "farming_super_seed_rice.png",
  972. default_drop = {},
  973. eat_value = 2,
  974. -- visual_scale = 1.3,
  975. steps = {8}, -- phases, steps per tier
  976. drops = {
  977. p1s8t1 = {
  978. max_items = 4,
  979. items = {
  980. { items = {'farming_super:seed_rice 3'} },
  981. { items = {'farming_super:seed_rice'}, rarity = 2},
  982. { items = {'farming_super:seed_rice'}, rarity = 5},
  983. }
  984. },
  985. },
  986. minlight = 10,
  987. maxlight = 15,
  988. fertility = {"grassland"},
  989. groups = {flammable = 4, },
  990. })
  991. minetest.register_craft({
  992. output = "farming_super:rice",
  993. type = "cooking",
  994. recipe = "farming_super:seed_rice",
  995. })
  996. minetest.register_decoration({
  997. name = "farming_super:rice_8_1",
  998. deco_type = "simple",
  999. place_on = {"default:dirt_with_rainforest_litter",},
  1000. sidelen = 16,
  1001. noise_params = {
  1002. offset = -0.0003,
  1003. scale = 0.0009,
  1004. spread = {x = 200, y = 200, z = 200},
  1005. seed = 1365,
  1006. octaves = 3,
  1007. persist = 0.6
  1008. },
  1009. biomes = {"jungle",},
  1010. y_max = 30,
  1011. y_min = 1,
  1012. decoration = "farming_super:rice_8_1",
  1013. param2 = 0,
  1014. })
  1015. dofile(modpath.."/crafts.lua")
  1016. minetest.register_node("farming_super:test", {
  1017. description = "Tester",
  1018. drawtype = "plantlike",
  1019. -- waving = 1,
  1020. -- visual_scale = 1.69,
  1021. tiles = {"farming_super_trellis.png"},
  1022. inventory_image = "farming_super_test.png",
  1023. paramtype = "light",
  1024. paramtype2 = "meshoptions",
  1025. sunlight_propagates = true,
  1026. -- walkable = false,
  1027. buildable_to = false,
  1028. --grape_color = color,
  1029. groups = {snappy = 2, plant=1, oddly_breakable_by_hand = 1, },
  1030. sounds = default.node_sound_leaves_defaults(),
  1031. selection_box = {
  1032. type = "fixed",
  1033. fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 0.5, 4 / 16},
  1034. },
  1035. collision_box = {
  1036. type = "fixed",
  1037. fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 0.5, 4 / 16},
  1038. },
  1039. place_param2 = 3,
  1040. })