init.lua 18 KB

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