init.lua 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801
  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 = "20230831",
  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. sounds = {}
  27. }
  28. -- default sound functions just incase
  29. function farming.sounds.node_sound_defaults() end
  30. function farming.sounds.node_sound_leaves_defaults() end
  31. function farming.sounds.node_sound_glass_defaults() end
  32. function farming.sounds.node_sound_wood_defaults() end
  33. function farming.sounds.node_sound_gravel_defaults() end
  34. -- sounds check
  35. if farming.mtg then farming.sounds = default end
  36. if farming.mcl then farming.sounds = mcl_sounds end
  37. -- check for creative mode or priv
  38. local creative_mode_cache = minetest.settings:get_bool("creative_mode")
  39. function farming.is_creative(name)
  40. return creative_mode_cache or minetest.check_player_privs(name, {creative = true})
  41. end
  42. local statistics = dofile(farming.path .. "/statistics.lua")
  43. -- Translation support
  44. local S = minetest.get_translator("farming")
  45. farming.translate = S
  46. -- Utility Function
  47. local time_speed = tonumber(minetest.settings:get("time_speed")) or 72
  48. local SECS_PER_CYCLE = (time_speed > 0 and (24 * 60 * 60) / time_speed) or 0
  49. local function clamp(x, min, max)
  50. return (x < min and min) or (x > max and max) or x
  51. end
  52. -- return amount of day or night that has elapsed
  53. -- dt is time elapsed, count_day if true counts day, otherwise night
  54. local function day_or_night_time(dt, count_day)
  55. local t_day = minetest.get_timeofday()
  56. local t1_day = t_day - dt / SECS_PER_CYCLE
  57. local t1_c, t2_c -- t1_c < t2_c and t2_c always in [0, 1)
  58. if count_day then
  59. if t_day < 0.25 then
  60. t1_c = t1_day + 0.75 -- Relative to sunup, yesterday
  61. t2_c = t_day + 0.75
  62. else
  63. t1_c = t1_day - 0.25 -- Relative to sunup, today
  64. t2_c = t_day - 0.25
  65. end
  66. else
  67. if t_day < 0.75 then
  68. t1_c = t1_day + 0.25 -- Relative to sundown, yesterday
  69. t2_c = t_day + 0.25
  70. else
  71. t1_c = t1_day - 0.75 -- Relative to sundown, today
  72. t2_c = t_day - 0.75
  73. end
  74. end
  75. local dt_c = clamp(t2_c, 0, 0.5) - clamp(t1_c, 0, 0.5) -- this cycle
  76. if t1_c < -0.5 then
  77. local nc = math.floor(-t1_c)
  78. t1_c = t1_c + nc
  79. dt_c = dt_c + 0.5 * nc + clamp(-t1_c - 0.5, 0, 0.5)
  80. end
  81. return dt_c * SECS_PER_CYCLE
  82. end
  83. -- Growth Logic
  84. local STAGE_LENGTH_AVG = tonumber(
  85. minetest.settings:get("farming_stage_length")) or 200
  86. local STAGE_LENGTH_DEV = STAGE_LENGTH_AVG / 6
  87. -- return plant name and stage from node provided
  88. local function plant_name_stage(node)
  89. local name
  90. if type(node) == "table" then
  91. if node.name then
  92. name = node.name
  93. elseif node.x and node.y and node.z then
  94. node = minetest.get_node_or_nil(node)
  95. name = node and node.name
  96. end
  97. else
  98. name = tostring(node)
  99. end
  100. if not name or name == "ignore" then
  101. return nil
  102. end
  103. local sep_pos = name:find("_[^_]+$")
  104. if sep_pos and sep_pos > 1 then
  105. local stage = tonumber(name:sub(sep_pos + 1))
  106. if stage and stage >= 0 then
  107. return name:sub(1, sep_pos - 1), stage
  108. end
  109. end
  110. return name, 0
  111. end
  112. -- Map from node name to
  113. -- { plant_name = ..., name = ..., stage = n, stages_left = { node_name, ... } }
  114. local plant_stages = {}
  115. farming.plant_stages = plant_stages
  116. --- Registers the stages of growth of a (possible plant) node.
  117. --
  118. -- @param node
  119. -- Node or position table, or node name.
  120. -- @return
  121. -- The (possibly zero) number of stages of growth the plant will go through
  122. -- before being fully grown, or nil if not a plant.
  123. local register_plant_node
  124. -- Recursive helper
  125. local function reg_plant_stages(plant_name, stage, force_last)
  126. local node_name = plant_name and plant_name .. "_" .. stage
  127. local node_def = node_name and minetest.registered_nodes[node_name]
  128. if not node_def then
  129. return nil
  130. end
  131. local stages = plant_stages[node_name]
  132. if stages then
  133. return stages
  134. end
  135. if minetest.get_item_group(node_name, "growing") > 0 then
  136. local ns = reg_plant_stages(plant_name, stage + 1, true)
  137. local stages_left = (ns and { ns.name, unpack(ns.stages_left) }) or {}
  138. stages = {
  139. plant_name = plant_name,
  140. name = node_name,
  141. stage = stage,
  142. stages_left = stages_left
  143. }
  144. if #stages_left > 0 then
  145. local old_constr = node_def.on_construct
  146. local old_destr = node_def.on_destruct
  147. minetest.override_item(node_name, {
  148. on_construct = function(pos)
  149. if old_constr then
  150. old_constr(pos)
  151. end
  152. farming.handle_growth(pos)
  153. end,
  154. on_destruct = function(pos)
  155. minetest.get_node_timer(pos):stop()
  156. if old_destr then
  157. old_destr(pos)
  158. end
  159. end,
  160. on_timer = function(pos, elapsed)
  161. return farming.plant_growth_timer(pos, elapsed, node_name)
  162. end,
  163. })
  164. end
  165. elseif force_last then
  166. stages = {
  167. plant_name = plant_name,
  168. name = node_name,
  169. stage = stage,
  170. stages_left = {}
  171. }
  172. else
  173. return nil
  174. end
  175. plant_stages[node_name] = stages
  176. return stages
  177. end
  178. local register_plant_node = function(node)
  179. local plant_name, stage = plant_name_stage(node)
  180. if plant_name then
  181. local stages = reg_plant_stages(plant_name, stage, false)
  182. return stages and #stages.stages_left
  183. else
  184. return nil
  185. end
  186. end
  187. local function set_growing(pos, stages_left)
  188. if not stages_left then
  189. return
  190. end
  191. local timer = minetest.get_node_timer(pos)
  192. if stages_left > 0 then
  193. if not timer:is_started() then
  194. local stage_length = statistics.normal(STAGE_LENGTH_AVG, STAGE_LENGTH_DEV)
  195. stage_length = clamp(stage_length, 0.5 * STAGE_LENGTH_AVG, 3.0 * STAGE_LENGTH_AVG)
  196. timer:set(stage_length, -0.5 * math.random() * STAGE_LENGTH_AVG)
  197. end
  198. elseif timer:is_started() then
  199. timer:stop()
  200. end
  201. end
  202. -- detects a crop at given position, starting or stopping growth timer when needed
  203. function farming.handle_growth(pos, node)
  204. if not pos then
  205. return
  206. end
  207. local stages_left = register_plant_node(node or pos)
  208. if stages_left then
  209. set_growing(pos, stages_left)
  210. end
  211. end
  212. minetest.after(0, function()
  213. for _, node_def in pairs(minetest.registered_nodes) do
  214. register_plant_node(node_def)
  215. end
  216. end)
  217. -- Just in case a growing type or added node is missed (also catches existing
  218. -- nodes added to map before timers were incorporated).
  219. minetest.register_abm({
  220. label = "Start crop timer",
  221. nodenames = {"group:growing"},
  222. interval = 300,
  223. chance = 1,
  224. catch_up = false,
  225. action = function(pos, node)
  226. -- check if group:growing node is a seed
  227. local def = minetest.registered_nodes[node.name]
  228. if def and def.groups and def.groups.seed then
  229. local next_stage = def.next_plant
  230. def = minetest.registered_nodes[next_stage]
  231. -- change seed to stage_1 or crop
  232. if def then
  233. local p2 = def.place_param2 or 1
  234. minetest.set_node(pos, {name = next_stage, param2 = p2})
  235. end
  236. else
  237. farming.handle_growth(pos, node)
  238. end
  239. end
  240. })
  241. -- Plant timer function that grows plants under the right conditions.
  242. function farming.plant_growth_timer(pos, elapsed, node_name)
  243. local stages = plant_stages[node_name]
  244. if not stages then
  245. return false
  246. end
  247. local max_growth = #stages.stages_left
  248. if max_growth <= 0 then
  249. return false
  250. end
  251. -- custom growth check
  252. local chk = minetest.registered_nodes[node_name].growth_check
  253. if chk then
  254. if chk(pos, node_name) then
  255. return true
  256. end
  257. -- otherwise check for wet soil beneath crop
  258. else
  259. local under = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z})
  260. if minetest.get_item_group(under.name, "soil") < 3 then
  261. return true
  262. end
  263. end
  264. local growth
  265. local light_pos = {x = pos.x, y = pos.y, z = pos.z}
  266. local lambda = elapsed / STAGE_LENGTH_AVG
  267. if lambda < 0.1 then
  268. return true
  269. end
  270. local MIN_LIGHT = minetest.registered_nodes[node_name].minlight or farming.min_light
  271. local MAX_LIGHT = minetest.registered_nodes[node_name].maxlight or farming.max_light
  272. if max_growth == 1 or lambda < 2.0 then
  273. local light = (minetest.get_node_light(light_pos) or 0)
  274. if light < MIN_LIGHT or light > MAX_LIGHT then
  275. return true
  276. end
  277. growth = 1
  278. else
  279. local night_light = (minetest.get_node_light(light_pos, 0) or 0)
  280. local day_light = (minetest.get_node_light(light_pos, 0.5) or 0)
  281. local night_growth = night_light >= MIN_LIGHT and night_light <= MAX_LIGHT
  282. local day_growth = day_light >= MIN_LIGHT and day_light <= MAX_LIGHT
  283. if not night_growth then
  284. if not day_growth then
  285. return true
  286. end
  287. lambda = day_or_night_time(elapsed, true) / STAGE_LENGTH_AVG
  288. elseif not day_growth then
  289. lambda = day_or_night_time(elapsed, false) / STAGE_LENGTH_AVG
  290. end
  291. growth = statistics.poisson(lambda, max_growth)
  292. if growth < 1 then
  293. return true
  294. end
  295. end
  296. if minetest.registered_nodes[stages.stages_left[growth]] then
  297. local p2 = minetest.registered_nodes[stages.stages_left[growth] ].place_param2 or 1
  298. minetest.swap_node(pos, {name = stages.stages_left[growth], param2 = p2})
  299. else
  300. return true
  301. end
  302. return growth ~= max_growth
  303. end
  304. -- refill placed plant by crabman (26/08/2015) updated by TenPlus1
  305. function farming.refill_plant(player, plantname, index)
  306. if not player then return end
  307. local inv = player:get_inventory()
  308. if not inv then return end
  309. local old_stack = inv:get_stack("main", index)
  310. if old_stack:get_name() ~= "" then
  311. return
  312. end
  313. for i, stack in ipairs(inv:get_list("main")) do
  314. if stack:get_name() == plantname and i ~= index then
  315. inv:set_stack("main", index, stack)
  316. stack:clear()
  317. inv:set_stack("main", i, stack)
  318. return
  319. end
  320. end
  321. end
  322. -- Place Seeds on Soil
  323. function farming.place_seed(itemstack, placer, pointed_thing, plantname)
  324. local pt = pointed_thing
  325. -- check if pointing at a node
  326. if not pt or pt.type ~= "node" then
  327. return
  328. end
  329. local under = minetest.get_node(pt.under)
  330. -- am I right-clicking on something that has a custom on_place set?
  331. -- thanks to Krock for helping with this issue :)
  332. local def = minetest.registered_nodes[under.name]
  333. if placer and itemstack and def and def.on_rightclick then
  334. return def.on_rightclick(pt.under, under, placer, itemstack, pt)
  335. end
  336. local above = minetest.get_node(pt.above)
  337. -- check if pointing at the top of the node
  338. if pt.above.y ~= pt.under.y + 1 then
  339. return
  340. end
  341. -- return if any of the nodes is not registered
  342. if not minetest.registered_nodes[under.name]
  343. or not minetest.registered_nodes[above.name] then
  344. return
  345. end
  346. -- can I replace above node, and am I pointing at soil
  347. if not minetest.registered_nodes[above.name].buildable_to
  348. or minetest.get_item_group(under.name, "soil") < 2
  349. -- avoid multiple seed placement bug
  350. or minetest.get_item_group(above.name, "plant") ~= 0 then
  351. return
  352. end
  353. -- is player planting seed?
  354. local name = placer and placer:get_player_name() or ""
  355. -- if not protected then add node and remove 1 item from the itemstack
  356. if not minetest.is_protected(pt.above, name) then
  357. local p2 = minetest.registered_nodes[plantname].place_param2 or 1
  358. minetest.set_node(pt.above, {name = plantname, param2 = p2})
  359. --minetest.get_node_timer(pt.above):start(1)
  360. --farming.handle_growth(pt.above)--, node)
  361. minetest.sound_play("default_place_node", {pos = pt.above, gain = 1.0})
  362. if placer and itemstack
  363. and not farming.is_creative(placer:get_player_name()) then
  364. local name = itemstack:get_name()
  365. itemstack:take_item()
  366. -- check for refill
  367. if itemstack:get_count() == 0 then
  368. minetest.after(0.2,
  369. farming.refill_plant,
  370. placer,
  371. name,
  372. placer:get_wield_index()
  373. )
  374. end
  375. end
  376. return itemstack
  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.sounds.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 = true
  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. -- disable crops Mineclone already has
  547. if farming.mcl then
  548. farming.carrot = nil
  549. farming.potato = nil
  550. farming.melon = nil
  551. farming.cocoa = nil
  552. farming.beetroot = nil
  553. farming.sunflower = nil
  554. farming.pumpkin = nil
  555. end
  556. -- helper function
  557. local function ddoo(file, check)
  558. if check then
  559. dofile(farming.path .. "/crops/" .. file)
  560. end
  561. end
  562. -- add additional crops and food (if enabled)
  563. ddoo("carrot.lua", farming.carrot)
  564. ddoo("potato.lua", farming.potato)
  565. ddoo("tomato.lua", farming.tomato)
  566. ddoo("cucumber.lua", farming.cucumber)
  567. ddoo("corn.lua", farming.corn)
  568. ddoo("coffee.lua", farming.coffee)
  569. ddoo("melon.lua", farming.melon)
  570. ddoo("pumpkin.lua", farming.pumpkin)
  571. ddoo("cocoa.lua", farming.cocoa)
  572. ddoo("raspberry.lua", farming.raspberry)
  573. ddoo("blueberry.lua", farming.blueberry)
  574. ddoo("rhubarb.lua", farming.rhubarb)
  575. ddoo("beans.lua", farming.beans)
  576. ddoo("grapes.lua", farming.grapes)
  577. ddoo("barley.lua", farming.barley)
  578. ddoo("hemp.lua", farming.hemp)
  579. ddoo("garlic.lua", farming.garlic)
  580. ddoo("onion.lua", farming.onion)
  581. ddoo("pepper.lua", farming.pepper)
  582. ddoo("pineapple.lua", farming.pineapple)
  583. ddoo("peas.lua", farming.peas)
  584. ddoo("beetroot.lua", farming.beetroot)
  585. ddoo("chili.lua", farming.chili)
  586. ddoo("ryeoatrice.lua", farming.grains)
  587. ddoo("rice.lua", farming.rice)
  588. ddoo("mint.lua", farming.mint)
  589. ddoo("cabbage.lua", farming.cabbage)
  590. ddoo("blackberry.lua", farming.blackberry)
  591. ddoo("soy.lua", farming.soy)
  592. ddoo("vanilla.lua", farming.vanilla)
  593. ddoo("lettuce.lua", farming.lettuce)
  594. ddoo("artichoke.lua", farming.artichoke)
  595. ddoo("parsley.lua", farming.parsley)
  596. ddoo("sunflower.lua", farming.sunflower)
  597. ddoo("strawberry.lua", farming.strawberry)
  598. ddoo("asparagus.lua", farming.asparagus)
  599. ddoo("eggplant.lua", farming.eggplant)
  600. ddoo("spinach.lua", farming.eggplant)
  601. ddoo("ginger.lua", farming.ginger)
  602. dofile(farming.path .. "/food.lua")
  603. if farming.mtg then
  604. dofile(farming.path .. "/compatibility.lua") -- Farming Plus compatibility
  605. end
  606. if minetest.get_modpath("lucky_block") then
  607. dofile(farming.path .. "/lucky_block.lua")
  608. end
  609. print("[MOD] Farming Redo loaded")