init.lua 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783
  1. --[[
  2. Farming Redo Mod
  3. by TenPlus1
  4. NEW growing routine by prestidigitator
  5. auto-refill by crabman77
  6. ]]
  7. farming = {
  8. mod = "redo",
  9. version = "20230407",
  10. path = minetest.get_modpath("farming"),
  11. select = {
  12. type = "fixed",
  13. fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}
  14. },
  15. select_final = {
  16. type = "fixed",
  17. fixed = {-0.5, -0.5, -0.5, 0.5, -2.5/16, 0.5}
  18. },
  19. registered_plants = {},
  20. min_light = 12,
  21. max_light = 15,
  22. mapgen = minetest.get_mapgen_setting("mg_name")
  23. }
  24. local creative_mode_cache = minetest.settings:get_bool("creative_mode")
  25. function farming.is_creative(name)
  26. return creative_mode_cache or minetest.check_player_privs(name, {creative = true})
  27. end
  28. local statistics = dofile(farming.path .. "/statistics.lua")
  29. -- Intllib
  30. local S
  31. if minetest.get_translator ~= nil then
  32. S = minetest.get_translator("farming") -- 5.x translation function
  33. else
  34. if minetest.get_modpath("intllib") then
  35. dofile(minetest.get_modpath("intllib") .. "/init.lua")
  36. if intllib.make_gettext_pair then
  37. gettext, ngettext = intllib.make_gettext_pair() -- new gettext method
  38. else
  39. gettext = intllib.Getter() -- old text file method
  40. end
  41. S = gettext
  42. else -- boilerplate function
  43. S = function(str, ...)
  44. local args = {...}
  45. return str:gsub("@%d+", function(match)
  46. return args[tonumber(match:sub(2))]
  47. end)
  48. end
  49. end
  50. end
  51. farming.intllib = S
  52. -- Utility Function
  53. local time_speed = tonumber(minetest.settings:get("time_speed")) or 72
  54. local SECS_PER_CYCLE = (time_speed > 0 and (24 * 60 * 60) / time_speed) or 0
  55. local function clamp(x, min, max)
  56. return (x < min and min) or (x > max and max) or x
  57. end
  58. -- return amount of day or night that has elapsed
  59. -- dt is time elapsed, count_day if true counts day, otherwise night
  60. local function day_or_night_time(dt, count_day)
  61. local t_day = minetest.get_timeofday()
  62. local t1_day = t_day - dt / SECS_PER_CYCLE
  63. local t1_c, t2_c -- t1_c < t2_c and t2_c always in [0, 1)
  64. if count_day then
  65. if t_day < 0.25 then
  66. t1_c = t1_day + 0.75 -- Relative to sunup, yesterday
  67. t2_c = t_day + 0.75
  68. else
  69. t1_c = t1_day - 0.25 -- Relative to sunup, today
  70. t2_c = t_day - 0.25
  71. end
  72. else
  73. if t_day < 0.75 then
  74. t1_c = t1_day + 0.25 -- Relative to sundown, yesterday
  75. t2_c = t_day + 0.25
  76. else
  77. t1_c = t1_day - 0.75 -- Relative to sundown, today
  78. t2_c = t_day - 0.75
  79. end
  80. end
  81. local dt_c = clamp(t2_c, 0, 0.5) - clamp(t1_c, 0, 0.5) -- this cycle
  82. if t1_c < -0.5 then
  83. local nc = math.floor(-t1_c)
  84. t1_c = t1_c + nc
  85. dt_c = dt_c + 0.5 * nc + clamp(-t1_c - 0.5, 0, 0.5)
  86. end
  87. return dt_c * SECS_PER_CYCLE
  88. end
  89. -- Growth Logic
  90. local STAGE_LENGTH_AVG = tonumber(
  91. minetest.settings:get("farming_stage_length")) or 200
  92. local STAGE_LENGTH_DEV = STAGE_LENGTH_AVG / 6
  93. -- return plant name and stage from node provided
  94. local function plant_name_stage(node)
  95. local name
  96. if type(node) == "table" then
  97. if node.name then
  98. name = node.name
  99. elseif node.x and node.y and node.z then
  100. node = minetest.get_node_or_nil(node)
  101. name = node and node.name
  102. end
  103. else
  104. name = tostring(node)
  105. end
  106. if not name or name == "ignore" then
  107. return nil
  108. end
  109. local sep_pos = name:find("_[^_]+$")
  110. if sep_pos and sep_pos > 1 then
  111. local stage = tonumber(name:sub(sep_pos + 1))
  112. if stage and stage >= 0 then
  113. return name:sub(1, sep_pos - 1), stage
  114. end
  115. end
  116. return name, 0
  117. end
  118. -- Map from node name to
  119. -- { plant_name = ..., name = ..., stage = n, stages_left = { node_name, ... } }
  120. local plant_stages = {}
  121. farming.plant_stages = plant_stages
  122. --- Registers the stages of growth of a (possible plant) node.
  123. --
  124. -- @param node
  125. -- Node or position table, or node name.
  126. -- @return
  127. -- The (possibly zero) number of stages of growth the plant will go through
  128. -- before being fully grown, or nil if not a plant.
  129. local register_plant_node
  130. -- Recursive helper
  131. local function reg_plant_stages(plant_name, stage, force_last)
  132. local node_name = plant_name and plant_name .. "_" .. stage
  133. local node_def = node_name and minetest.registered_nodes[node_name]
  134. if not node_def then
  135. return nil
  136. end
  137. local stages = plant_stages[node_name]
  138. if stages then
  139. return stages
  140. end
  141. if minetest.get_item_group(node_name, "growing") > 0 then
  142. local ns = reg_plant_stages(plant_name, stage + 1, true)
  143. local stages_left = (ns and { ns.name, unpack(ns.stages_left) }) or {}
  144. stages = {
  145. plant_name = plant_name,
  146. name = node_name,
  147. stage = stage,
  148. stages_left = stages_left
  149. }
  150. if #stages_left > 0 then
  151. local old_constr = node_def.on_construct
  152. local old_destr = node_def.on_destruct
  153. minetest.override_item(node_name, {
  154. on_construct = function(pos)
  155. if old_constr then
  156. old_constr(pos)
  157. end
  158. farming.handle_growth(pos)
  159. end,
  160. on_destruct = function(pos)
  161. minetest.get_node_timer(pos):stop()
  162. if old_destr then
  163. old_destr(pos)
  164. end
  165. end,
  166. on_timer = function(pos, elapsed)
  167. return farming.plant_growth_timer(pos, elapsed, node_name)
  168. end,
  169. })
  170. end
  171. elseif force_last then
  172. stages = {
  173. plant_name = plant_name,
  174. name = node_name,
  175. stage = stage,
  176. stages_left = {}
  177. }
  178. else
  179. return nil
  180. end
  181. plant_stages[node_name] = stages
  182. return stages
  183. end
  184. local register_plant_node = function(node)
  185. local plant_name, stage = plant_name_stage(node)
  186. if plant_name then
  187. local stages = reg_plant_stages(plant_name, stage, false)
  188. return stages and #stages.stages_left
  189. else
  190. return nil
  191. end
  192. end
  193. local function set_growing(pos, stages_left)
  194. if not stages_left then
  195. return
  196. end
  197. local timer = minetest.get_node_timer(pos)
  198. if stages_left > 0 then
  199. if not timer:is_started() then
  200. local stage_length = statistics.normal(STAGE_LENGTH_AVG, STAGE_LENGTH_DEV)
  201. stage_length = clamp(stage_length, 0.5 * STAGE_LENGTH_AVG, 3.0 * STAGE_LENGTH_AVG)
  202. timer:set(stage_length, -0.5 * math.random() * STAGE_LENGTH_AVG)
  203. end
  204. elseif timer:is_started() then
  205. timer:stop()
  206. end
  207. end
  208. -- detects a crop at given position, starting or stopping growth timer when needed
  209. function farming.handle_growth(pos, node)
  210. if not pos then
  211. return
  212. end
  213. local stages_left = register_plant_node(node or pos)
  214. if stages_left then
  215. set_growing(pos, stages_left)
  216. end
  217. end
  218. minetest.after(0, function()
  219. for _, node_def in pairs(minetest.registered_nodes) do
  220. register_plant_node(node_def)
  221. end
  222. end)
  223. -- Just in case a growing type or added node is missed (also catches existing
  224. -- nodes added to map before timers were incorporated).
  225. minetest.register_abm({
  226. label = "Start crop timer",
  227. nodenames = {"group:growing"},
  228. interval = 300,
  229. chance = 1,
  230. catch_up = false,
  231. action = function(pos, node)
  232. -- check if group:growing node is a seed
  233. local def = minetest.registered_nodes[node.name]
  234. if def and def.groups and def.groups.seed then
  235. local next_stage = def.next_plant
  236. def = minetest.registered_nodes[next_stage]
  237. -- change seed to stage_1 or crop
  238. if def then
  239. local p2 = def.place_param2 or 1
  240. minetest.set_node(pos, {name = next_stage, param2 = p2})
  241. end
  242. else
  243. farming.handle_growth(pos, node)
  244. end
  245. end
  246. })
  247. -- Plant timer function that grows plants under the right conditions.
  248. function farming.plant_growth_timer(pos, elapsed, node_name)
  249. local stages = plant_stages[node_name]
  250. if not stages then
  251. return false
  252. end
  253. local max_growth = #stages.stages_left
  254. if max_growth <= 0 then
  255. return false
  256. end
  257. -- custom growth check
  258. local chk = minetest.registered_nodes[node_name].growth_check
  259. if chk then
  260. if chk(pos, node_name) then
  261. return true
  262. end
  263. -- otherwise check for wet soil beneath crop
  264. else
  265. local under = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z})
  266. if minetest.get_item_group(under.name, "soil") < 3 then
  267. return true
  268. end
  269. end
  270. local growth
  271. local light_pos = {x = pos.x, y = pos.y, z = pos.z}
  272. local lambda = elapsed / STAGE_LENGTH_AVG
  273. if lambda < 0.1 then
  274. return true
  275. end
  276. local MIN_LIGHT = minetest.registered_nodes[node_name].minlight or farming.min_light
  277. local MAX_LIGHT = minetest.registered_nodes[node_name].maxlight or farming.max_light
  278. if max_growth == 1 or lambda < 2.0 then
  279. local light = (minetest.get_node_light(light_pos) or 0)
  280. if light < MIN_LIGHT or light > MAX_LIGHT then
  281. return true
  282. end
  283. growth = 1
  284. else
  285. local night_light = (minetest.get_node_light(light_pos, 0) or 0)
  286. local day_light = (minetest.get_node_light(light_pos, 0.5) or 0)
  287. local night_growth = night_light >= MIN_LIGHT and night_light <= MAX_LIGHT
  288. local day_growth = day_light >= MIN_LIGHT and day_light <= MAX_LIGHT
  289. if not night_growth then
  290. if not day_growth then
  291. return true
  292. end
  293. lambda = day_or_night_time(elapsed, true) / STAGE_LENGTH_AVG
  294. elseif not day_growth then
  295. lambda = day_or_night_time(elapsed, false) / STAGE_LENGTH_AVG
  296. end
  297. growth = statistics.poisson(lambda, max_growth)
  298. if growth < 1 then
  299. return true
  300. end
  301. end
  302. if minetest.registered_nodes[stages.stages_left[growth]] then
  303. local p2 = minetest.registered_nodes[stages.stages_left[growth] ].place_param2 or 1
  304. minetest.swap_node(pos, {name = stages.stages_left[growth], param2 = p2})
  305. else
  306. return true
  307. end
  308. return growth ~= max_growth
  309. end
  310. -- refill placed plant by crabman (26/08/2015) updated by TenPlus1
  311. function farming.refill_plant(player, plantname, index)
  312. if not player then return end
  313. local inv = player:get_inventory()
  314. if not inv then return end
  315. local old_stack = inv:get_stack("main", index)
  316. if old_stack:get_name() ~= "" then
  317. return
  318. end
  319. for i, stack in ipairs(inv:get_list("main")) do
  320. if stack:get_name() == plantname and i ~= index then
  321. inv:set_stack("main", index, stack)
  322. stack:clear()
  323. inv:set_stack("main", i, stack)
  324. return
  325. end
  326. end
  327. end
  328. -- Place Seeds on Soil
  329. function farming.place_seed(itemstack, placer, pointed_thing, plantname)
  330. local pt = pointed_thing
  331. -- check if pointing at a node
  332. if not pt or pt.type ~= "node" then
  333. return
  334. end
  335. local under = minetest.get_node(pt.under)
  336. -- am I right-clicking on something that has a custom on_place set?
  337. -- thanks to Krock for helping with this issue :)
  338. local def = minetest.registered_nodes[under.name]
  339. if placer and itemstack and def and def.on_rightclick then
  340. return def.on_rightclick(pt.under, under, placer, itemstack, pt)
  341. end
  342. local above = minetest.get_node(pt.above)
  343. -- check if pointing at the top of the node
  344. if pt.above.y ~= pt.under.y + 1 then
  345. return
  346. end
  347. -- return if any of the nodes is not registered
  348. if not minetest.registered_nodes[under.name]
  349. or not minetest.registered_nodes[above.name] then
  350. return
  351. end
  352. -- can I replace above node, and am I pointing at soil
  353. if not minetest.registered_nodes[above.name].buildable_to
  354. or minetest.get_item_group(under.name, "soil") < 2
  355. -- avoid multiple seed placement bug
  356. or minetest.get_item_group(above.name, "plant") ~= 0 then
  357. return
  358. end
  359. -- is player planting seed?
  360. local name = placer and placer:get_player_name() or ""
  361. -- if not protected then add node and remove 1 item from the itemstack
  362. if not minetest.is_protected(pt.above, name) then
  363. local p2 = minetest.registered_nodes[plantname].place_param2 or 1
  364. minetest.set_node(pt.above, {name = plantname, param2 = p2})
  365. --minetest.get_node_timer(pt.above):start(1)
  366. --farming.handle_growth(pt.above)--, node)
  367. minetest.sound_play("default_place_node", {pos = pt.above, gain = 1.0})
  368. if placer and itemstack
  369. and not farming.is_creative(placer:get_player_name()) then
  370. local name = itemstack:get_name()
  371. itemstack:take_item()
  372. -- check for refill
  373. if itemstack:get_count() == 0 then
  374. minetest.after(0.2,
  375. farming.refill_plant,
  376. placer,
  377. name,
  378. placer:get_wield_index()
  379. )
  380. end
  381. end
  382. return itemstack
  383. end
  384. end
  385. -- Function to register plants (default farming compatibility)
  386. farming.register_plant = function(name, def)
  387. if not def.steps then
  388. return nil
  389. end
  390. local mname = name:split(":")[1]
  391. local pname = name:split(":")[2]
  392. -- Check def
  393. def.description = def.description or S("Seed")
  394. def.inventory_image = def.inventory_image or "unknown_item.png"
  395. def.minlight = def.minlight or 12
  396. def.maxlight = def.maxlight or 15
  397. -- Register seed
  398. minetest.register_node(":" .. mname .. ":seed_" .. pname, {
  399. description = def.description,
  400. tiles = {def.inventory_image},
  401. inventory_image = def.inventory_image,
  402. wield_image = def.inventory_image,
  403. drawtype = "signlike",
  404. groups = {seed = 1, snappy = 3, attached_node = 1, flammable = 2, growing = 1},
  405. paramtype = "light",
  406. paramtype2 = "wallmounted",
  407. walkable = false,
  408. sunlight_propagates = true,
  409. selection_box = farming.select,
  410. place_param2 = 1, -- place seed flat
  411. next_plant = mname .. ":" .. pname .. "_1",
  412. on_place = function(itemstack, placer, pointed_thing)
  413. return farming.place_seed(itemstack, placer, pointed_thing,
  414. mname .. ":seed_" .. pname)
  415. end
  416. })
  417. -- Register harvest
  418. minetest.register_craftitem(":" .. mname .. ":" .. pname, {
  419. description = pname:gsub("^%l", string.upper),
  420. inventory_image = mname .. "_" .. pname .. ".png",
  421. groups = def.groups or {flammable = 2},
  422. })
  423. -- Register growing steps
  424. for i = 1, def.steps do
  425. local base_rarity = 1
  426. if def.steps ~= 1 then
  427. base_rarity = 8 - (i - 1) * 7 / (def.steps - 1)
  428. end
  429. local drop = {
  430. items = {
  431. {items = {mname .. ":" .. pname}, rarity = base_rarity},
  432. {items = {mname .. ":" .. pname}, rarity = base_rarity * 2},
  433. {items = {mname .. ":seed_" .. pname}, rarity = base_rarity},
  434. {items = {mname .. ":seed_" .. pname}, rarity = base_rarity * 2},
  435. }
  436. }
  437. local sel = farming.select
  438. local g = {
  439. snappy = 3, flammable = 2, plant = 1, growing = 1,
  440. attached_node = 1, not_in_creative_inventory = 1,
  441. }
  442. -- Last step doesn't need growing=1 so Abm never has to check these
  443. -- also increase selection box for visual indication plant has matured
  444. if i == def.steps then
  445. sel = farming.select_final
  446. g.growing = 0
  447. end
  448. local node_name = mname .. ":" .. pname .. "_" .. i
  449. local next_plant = nil
  450. if i < def.steps then
  451. next_plant = mname .. ":" .. pname .. "_" .. (i + 1)
  452. end
  453. minetest.register_node(node_name, {
  454. drawtype = "plantlike",
  455. waving = 1,
  456. tiles = {mname .. "_" .. pname .. "_" .. i .. ".png"},
  457. paramtype = "light",
  458. paramtype2 = def.paramtype2,
  459. place_param2 = def.place_param2,
  460. walkable = false,
  461. buildable_to = true,
  462. sunlight_propagates = true,
  463. drop = drop,
  464. selection_box = sel,
  465. groups = g,
  466. sounds = default.node_sound_leaves_defaults(),
  467. minlight = def.minlight,
  468. maxlight = def.maxlight,
  469. next_plant = next_plant
  470. })
  471. end
  472. -- add to farming.registered_plants
  473. farming.registered_plants[mname .. ":" .. pname] = {
  474. crop = mname .. ":" .. pname,
  475. seed = mname .. ":seed_" .. pname,
  476. steps = def.steps,
  477. minlight = def.minlight,
  478. maxlight = def.maxlight
  479. }
  480. --print(dump(farming.registered_plants[mname .. ":" .. pname]))
  481. -- Return info
  482. return {seed = mname .. ":seed_" .. pname, harvest = mname .. ":" .. pname}
  483. end
  484. -- default settings
  485. farming.asparagus = 0.002
  486. farming.eggplant = 0.002
  487. farming.spinach = 0.002
  488. farming.carrot = 0.001
  489. farming.potato = 0.001
  490. farming.tomato = 0.001
  491. farming.cucumber = 0.001
  492. farming.corn = 0.001
  493. farming.coffee = 0.001
  494. farming.melon = 0.001
  495. farming.pumpkin = 0.001
  496. farming.cocoa = true
  497. farming.raspberry = 0.001
  498. farming.blueberry = 0.001
  499. farming.rhubarb = 0.001
  500. farming.beans = 0.001
  501. farming.grapes = 0.001
  502. farming.barley = true
  503. farming.chili = 0.003
  504. farming.hemp = 0.003
  505. farming.garlic = 0.001
  506. farming.onion = 0.001
  507. farming.pepper = 0.002
  508. farming.pineapple = 0.001
  509. farming.peas = 0.001
  510. farming.beetroot = 0.001
  511. farming.mint = 0.005
  512. farming.cabbage = 0.001
  513. farming.blackberry = 0.002
  514. farming.soy = 0.001
  515. farming.vanilla = 0.001
  516. farming.lettuce = 0.001
  517. farming.artichoke = 0.001
  518. farming.parsley = 0.002
  519. farming.sunflower = 0.001
  520. farming.ginger = 0.002
  521. farming.strawberry = not minetest.get_modpath("ethereal") and 0.002
  522. farming.grains = true
  523. farming.rice = true
  524. -- Load new global settings if found inside mod folder
  525. local input = io.open(farming.path.."/farming.conf", "r")
  526. if input then
  527. dofile(farming.path .. "/farming.conf")
  528. input:close()
  529. end
  530. -- load new world-specific settings if found inside world folder
  531. local worldpath = minetest.get_worldpath()
  532. input = io.open(worldpath.."/farming.conf", "r")
  533. if input then
  534. dofile(worldpath .. "/farming.conf")
  535. input:close()
  536. end
  537. -- important items
  538. dofile(farming.path.."/soil.lua")
  539. dofile(farming.path.."/hoes.lua")
  540. dofile(farming.path.."/grass.lua")
  541. dofile(farming.path.."/utensils.lua")
  542. -- default crops
  543. dofile(farming.path.."/crops/wheat.lua")
  544. dofile(farming.path.."/crops/cotton.lua")
  545. -- helper function
  546. local function ddoo(file, check)
  547. if check then
  548. dofile(farming.path .. "/crops/" .. file)
  549. end
  550. end
  551. -- add additional crops and food (if enabled)
  552. ddoo("carrot.lua", farming.carrot)
  553. ddoo("potato.lua", farming.potato)
  554. ddoo("tomato.lua", farming.tomato)
  555. ddoo("cucumber.lua", farming.cucumber)
  556. ddoo("corn.lua", farming.corn)
  557. ddoo("coffee.lua", farming.coffee)
  558. ddoo("melon.lua", farming.melon)
  559. ddoo("pumpkin.lua", farming.pumpkin)
  560. ddoo("cocoa.lua", farming.cocoa)
  561. ddoo("raspberry.lua", farming.raspberry)
  562. ddoo("blueberry.lua", farming.blueberry)
  563. ddoo("rhubarb.lua", farming.rhubarb)
  564. ddoo("beans.lua", farming.beans)
  565. ddoo("grapes.lua", farming.grapes)
  566. ddoo("barley.lua", farming.barley)
  567. ddoo("hemp.lua", farming.hemp)
  568. ddoo("garlic.lua", farming.garlic)
  569. ddoo("onion.lua", farming.onion)
  570. ddoo("pepper.lua", farming.pepper)
  571. ddoo("pineapple.lua", farming.pineapple)
  572. ddoo("peas.lua", farming.peas)
  573. ddoo("beetroot.lua", farming.beetroot)
  574. ddoo("chili.lua", farming.chili)
  575. ddoo("ryeoatrice.lua", farming.grains)
  576. ddoo("rice.lua", farming.rice)
  577. ddoo("mint.lua", farming.mint)
  578. ddoo("cabbage.lua", farming.cabbage)
  579. ddoo("blackberry.lua", farming.blackberry)
  580. ddoo("soy.lua", farming.soy)
  581. ddoo("vanilla.lua", farming.vanilla)
  582. ddoo("lettuce.lua", farming.lettuce)
  583. ddoo("artichoke.lua", farming.artichoke)
  584. ddoo("parsley.lua", farming.parsley)
  585. ddoo("sunflower.lua", farming.sunflower)
  586. ddoo("strawberry.lua", farming.strawberry)
  587. ddoo("asparagus.lua", farming.asparagus)
  588. ddoo("eggplant.lua", farming.eggplant)
  589. ddoo("spinach.lua", farming.eggplant)
  590. ddoo("ginger.lua", farming.ginger)
  591. dofile(farming.path .. "/food.lua")
  592. dofile(farming.path .. "/compatibility.lua") -- Farming Plus compatibility
  593. if minetest.get_modpath("lucky_block") then
  594. dofile(farming.path .. "/lucky_block.lua")
  595. end
  596. print("[MOD] Farming Redo loaded")