[Mod] Farming Redo [1.49] [farming]
Re: [Mod] Farming Redo [1.49] [farming]
The rhubarb is growing too slowly for me... Can you somehow change the growth time of the rhubarb itself?
Re: [Mod] Farming Redo [1.49] [farming]
@ soeren06 - Rhubarb doesn't like bright conditions in real life so it grows between light levels 10 and 12.
Update:
- Hoe Bomb's remove dry shrub along with flora.
Re: [Mod] Farming Redo [1.49] [farming]
I asked my mum. She said in dry ground you want the rhubarb in a slightly shady place and in sufficiently wet ground you want it in bright sunlight.
Whatever I say is CC0
Update:
- Add weeds that can appear on tilled soil when not in use.
- Add weed bale that can be crafted from 9x weed.
- Add 'farming_disable_weeds' setting.
- Add weed bale that can be crafted from 9x weed.
- Add 'farming_disable_weeds' setting.
Update:
- Fix bug where api registered crops would grow from seed straight to stage 2.
Update:
- Tweaked crop drops to something more sensible.
- Replace crop timer Abm with Lbm.
- Replace crop timer Abm with Lbm.
Update:
- Hoe-bomb removes grass on top of soil.
Update:
- Increase scarecrow weed protection area to 8 blocks.
Update:
- Updated Hungarian translation (thx kmarton815)
- Add missing food groups.
- Update Chinese translation (thx maxchen32)
- Add missing food groups.
- Update Chinese translation (thx maxchen32)
Update:
- Hoe Bomb uses moveresult.
- Tidy code.
- Tidy code.
Update:
- Add water floorbs, craft using 8x buckets of water and 1x gelatin in middle.
Note: It's easier to cook water floorbs in a furnace to produce salt than buckets of water which bug out and you end up loosing the bucket in a furnace.
Note: It's easier to cook water floorbs in a furnace to produce salt than buckets of water which bug out and you end up loosing the bucket in a furnace.
- Nininik
- Member
- Posts: 945
- Joined: Thu Apr 06, 2023 01:55
- GitHub: nininik0
- IRC: nininik
- In-game: nininik
- Location: CA, Team thunderstrike headquarters
- Contact:
Re: [Mod] Farming Redo [1.49] [farming]
I occasionally get a OOM error from farming, what could possibly be the cause and how could it be fixed?
↯Glory to Team Thunderstrike!↯
↯T.T.S.↯
↯T.T.S.↯
Re: [Mod] Farming Redo [1.49] [farming]
@Nininik - Could you list your system specs, Os and version, and which Minetest/Luanti client you are using ?
Update:
- Added Danish translation (thx jeppebundsgaard)
- Fixed readme links.
- Fixed readme links.
Update:
- Added Polish translation (thx BuszmoPL)
Re: [Mod] Farming Redo [1.49] [farming]
I've been creating some "undergarden" crops for my personal game and, in working on these crops that have to grow in low light, I noticed that the min and max light settings in the crop registrations didn't seem to be used. Except for rhubarb, which also has a setting in the node registrations, all the crops with custom min and max lights in the crop registrations were falling back to the default which, for example, meant that crops that were intended to grow in min_light 7 didn't grow until min_light 12, the default. I documented what I found and my personal fix here:
In practical use, most of the time this wouldn't be noticed by players, but it accounts for crops that should grow in low light needing more light than expected.
Undergarden crops: potatos, beets, carrots, onions for underground mobs.
Code: Select all
--In the init.lua, we see the default farming.min_light level etc set here:
farming = {
mod = "redo",
version = "20250717",
path = core.get_modpath("farming"),
select = {type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}},
select_final = {type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -2.5/16, 0.5}},
registered_plants = {},
min_light = 12, max_light = 15,
...
}
--In crops like spinach, we see a light level set in the plant registration like this:
farming.registered_plants["farming:spinach"] = {
crop = "farming:spinach",
seed = "farming:spinach",
minlight = 7,
maxlight = farming.max_light,
steps = 4
}
--Rhubarb works because it has a light level set in the node registration:
-- crop definition
local def = {
description = S("Rhubarb") .. S(" Crop"),
drawtype = "plantlike",
tiles = {"farming_rhubarb_1.png"},
paramtype = "light",
sunlight_propagates = true,
...
is_ground_content = false,
sounds = farming.node_sound_leaves_defaults(),
minlight = 10,
maxlight = 12
}
--[[
In the init.lua, every time a plant is set to grow, there is a light check in the function farming.plant_growth_timer(pos, elapsed, node_name). That function checks the light at the position of a node by name. If it can't find a light level in the node meta, it falls back to the default:
--]]
if lambda < 0.1 then return true end
local MIN_LIGHT = core.registered_nodes[node_name].minlight or farming.min_light
local MAX_LIGHT = core.registered_nodes[node_name].maxlight or farming.max_light
if max_growth == 1 or lambda < 2.0 then
--[[
The bug is, at that moment, the node is named something like farming:spinach_1 but that node does not have the setting in its definition (in rhubarb, the setting was also added to the node definitions). The light levels are set in the plant registration, so this function needs to check for the light levels there (or all the crops need to set light levels in the nodes). I fixed mine like this:
--]]
--sc fix for finding plant def name from node
local base_name = node_name:match("^(.-)_%d+$") or node_name
local plant_def = farming.registered_plants[base_name]
--fix for picking up light levels from plant def
local MIN_LIGHT = (plant_def and plant_def.minlight) or core.registered_nodes[node_name].minlight or farming.min_light
local MAX_LIGHT = (plant_def and plant_def.maxlight) or core.registered_nodes[node_name].maxlight or farming.max_light
--[[
The fix strips away the extra extension on the node name, such as _1, _2, etc, then checks the plant def (the code above for spinach) for the light levels. This works in my game.
I think the same type of bug affects selection box choices but I didn't test and document that one.
--]]
Undergarden crops: potatos, beets, carrots, onions for underground mobs.
Re: [Mod] Farming Redo [1.49] [farming]
@Slightly - Can you explain what you mean by light settings in crop definition not being used ?
I just tested the minlight and maxlight settings on manually defined crops and farming.register_plant crops and the light settings work fine on both during growth. The crop nodes themselves contain the light settings once defined (which are used for growing) as does the farming.registered_plants entry.
I just tested the minlight and maxlight settings on manually defined crops and farming.register_plant crops and the light settings work fine on both during growth. The crop nodes themselves contain the light settings once defined (which are used for growing) as does the farming.registered_plants entry.
Re: [Mod] Farming Redo [1.49] [farming]
It's been a while since I documented this, so my notes above are more accurate than my memory. When I was making my low light nodes and they weren't growing, my debugging found that the growth function was only reading the default settings, so they'd only grow at those default levels (except rhubarb). So, where I had a crop that had a min_light of 7 in the crop registration, watching the debug msgs and detecting the current light level, I could see that the node that I was watching would not grow at level 11, but would at 12, and that the light setting for the node was reading 12 (default) rather than 7.TenPlus1 wrote: ↑Fri Nov 14, 2025 14:25@Slightly - Can you explain what you mean by light settings in crop definition not being used ?
I just tested the minlight and maxlight settings on manually defined crops and farming.register_plant crops and the light settings work fine on both during growth. The crop nodes themselves contain the light settings once defined (which are used for growing) as does the farming.registered_plants entry.
The fix I used that made sure it read my settings from my crop registration fixed the issue. I looked at the code and did some quick tests with your most recent release at the time and it seemed to be doing the same thing, but since most of my testing was on my own fork, I may have missed something. If spinach grows for you in light level 8, maybe yours is fine. If players see theirs doesn't, they have this info to try.
Re: [Mod] Farming Redo [1.49] [farming]
@Slightly - Can you show me your code please so I can see what may be happening.
Re: [Mod] Farming Redo [1.49] [farming]
Hopefully, this will make clearer what I mean. It's the alleged bug replicated with the latest release [EDIT: Oops, this is using the code I downloaded 10/19_if it's changed since then, let me know and I'll test again.] from contentdb. This is the growth timer with debugging (error type for visibility) to show node (spinach which has a min_level of 7 in the crop def), light settings the code is getting from the node(here it's falling back to default), and the light level that is at that pos.
I just downloaded this from contentdb for this test. [EDIT: Mistake, code's a month old.] Other than this, the code I used to fix it is in the snippet in my first post, so not sure what else I can show. If I planted this in low light, it wouldn't grow because it "thinks" it needs level 12 as you can see here. Hope that helps. Like I said, I might have missed something. I'm a hobbyist at best.
I just downloaded this from contentdb for this test. [EDIT: Mistake, code's a month old.] Other than this, the code I used to fix it is in the snippet in my first post, so not sure what else I can show. If I planted this in low light, it wouldn't grow because it "thinks" it needs level 12 as you can see here. Hope that helps. Like I said, I might have missed something. I'm a hobbyist at best.
Who is online
Users browsing this forum: No registered users and 0 guests