[Mod] Farming Redo [1.49] [farming]

User avatar
TenPlus1
Member
Posts: 4222
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Farming Redo [1.49] [farming]

by TenPlus1 » Post

@Slightly - I changed the spinach minlight level to 7 as a test and planted a row with a few print statements enabled to show minlight, maxlight and node_name, they all grew fine and showed the light levels I changed with no bugs.

How are you setting the light levels, are you using minlight and maxlight or naming them differently ?

Slightly
Member
Posts: 130
Joined: Sun May 15, 2022 22:29
In-game: Slightly

Re: [Mod] Farming Redo [1.49] [farming]

by Slightly » Post

TenPlus1 wrote:
Fri Nov 14, 2025 18:17
@Slightly - I changed the spinach minlight level to 7 as a test and planted a row with a few print statements enabled to show minlight, maxlight and node_name, they all grew fine and showed the light levels I changed with no bugs.

How are you setting the light levels, are you using minlight and maxlight or naming them differently ?
I didn't touch the spinach. It's in the crop file as
-- add to registered_plants

farming.registered_plants["farming:spinach"] = {
crop = "farming:spinach",
seed = "farming:spinach",
minlight = 7,
maxlight = farming.max_light,
steps = 4
}

Spinach is already minlight = 7. I didn't do anything at all to it. Just used it as an example. How did you change it? Did you put it in the node definition instead of this registered_plants?
Attachments
nogrowat11.png
nogrowat11.png (209.45 KiB) Viewed 176 times

User avatar
TenPlus1
Member
Posts: 4222
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Farming Redo [1.49] [farming]

by TenPlus1 » Post

The farming.registered_plants["spinach"] contains information for 3rd party mods, to change the actual crop light level you would need to add "minlight = 7," to the actual crop definition on line 21 of the spinach.lua file, or the same line using farming.register_plant as per the api.txt definition.

Slightly
Member
Posts: 130
Joined: Sun May 15, 2022 22:29
In-game: Slightly

Re: [Mod] Farming Redo [1.49] [farming]

by Slightly » Post

TenPlus1 wrote:
Sat Nov 15, 2025 06:19
The farming.registered_plants["spinach"] contains information for 3rd party mods, to change the actual crop light level you would need to add "minlight = 7," to the actual crop definition on line 21 of the spinach.lua file, or the same line using farming.register_plant as per the api.txt definition.
Ok, that makes sense given the original growth timing function (mine's doing it differently now), but I still don't get that from reading the api.txt. Probably some basic coding thing I'm still missing. Just for my information, what's the minlight in the registered plants doing, then? When would it be used?

User avatar
TenPlus1
Member
Posts: 4222
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Farming Redo [1.49] [farming]

by TenPlus1 » Post

@Slightly - Usually most mods will use the farming.add_plant() api function to register crops, which will add the relevant nodes, seeds and drops while adding the relevant crop information to the farming.registered_crops[] table for 3rd party mod lookup. Most of the crops in farming redo I register manually simply for custom control, which needs to add each of the above seperately.

Slightly
Member
Posts: 130
Joined: Sun May 15, 2022 22:29
In-game: Slightly

Re: [Mod] Farming Redo [1.49] [farming]

by Slightly » Post

TenPlus1 wrote:
Sat Nov 15, 2025 11:21
@Slightly - Usually most mods will use the farming.add_plant() api function to register crops, which will add the relevant nodes, seeds and drops while adding the relevant crop information to the farming.registered_crops[] table for 3rd party mod lookup. Most of the crops in farming redo I register manually simply for custom control, which needs to add each of the above seperately.
Ok, thanks for explaining. So, in that case, only rhubarb currently has different light settings, I guess.

Except my undergarden crops. It's pretty fun to go under the regular garden and see the root crops growing below. :)

User avatar
TenPlus1
Member
Posts: 4222
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Farming Redo [1.49] [farming]

by TenPlus1 » Post

@Slightly - Underground crops will be a nice addition, will be eager to see your mod when it's complete :)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest