[Mod] Farming Redo [1.45] [farming]

User avatar
TenPlus1
Member
Posts: 2886
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Update

by TenPlus1 » Post

- Added some nil checks when placing seed items on nodes with on_rightclick active

ThorfinnS
Member
Posts: 280
Joined: Mon Feb 25, 2019 22:05
GitHub: ThorfinnS

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

by ThorfinnS » Post

Oh, cool.

Looking forward to seeing if nil checks gets rid of the occasional weirdnesses interacting with lib_ecology. One just had to learn which plants not to plant or you would get warning messages popping up all the time. Strawberries for sure. Couple others, too, but I don't recall which.

ThorfinnS
Member
Posts: 280
Joined: Mon Feb 25, 2019 22:05
GitHub: ThorfinnS

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

by ThorfinnS » Post

Trying to figure out whether you had a detectable pattern in mind when assigning groups.

For example, the thing you plant with corn is in group food_corn, beets is food_beetroot, but the juicer is food_juicer. So looks like I can't just strip off anything with group food_* and get plantable things.

Clyde did his cucina_vegana by having anything plantable be seed=1. An improvement, but not quite as useful as it might be. For example, setting seed=2 might mean you plant one of the crop, while seed=1 means it has a seed distinct from the crop.

Makes it easier to adapt things to farming_nextgen, as well as things like the threshing floor and handmill from cottages.

Question is whether that's capability you are interested in including, or if it's something that should be a stand-alone mod. It wouldn't be that hard to do an on-load parsing of registration data, then add the group seed=2 (or whatever), but maybe coming up with some suggested standard across mods, and people either embrace that voluntary standard or not, at penalty of not integrating well with other mods.

What I'm asking, then, is whether there's some standard that would work better with your long-term vision, and also whether you want to add that (PR or on your own) or simply do it through a stand-alone mod.

User avatar
TenPlus1
Member
Posts: 2886
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

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

by TenPlus1 » Post

The food_* groups were for easy recipes so that the same group name could be used for different items and still make the recipe :) the farming redo mod however has a global table called farming.registered_plants that holds any information on a crop/seed/growth/light you might need though.

https://notabug.org/TenPlus1/farming/sr ... pi.txt#L12

ThorfinnS
Member
Posts: 280
Joined: Mon Feb 25, 2019 22:05
GitHub: ThorfinnS

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

by ThorfinnS » Post

Right. That was in my post, but it got too long, and that's part of what ended up on the cutting room floor.

The situation is that one student is writing a generalized backpack mod, where there is an easier to craft backpack limited to specific types of items. So there's a cheap seed packet you can make early, way before you have wool, because between cucina vegana and farming redo all the inventory space is filled before you find a place to build. All spaces are filled with stuff you wouldn't or couldn't collect but for the existence of those mods. Why bother with leaves if there's no mod that uses them, for instance. Just toss 'em out. Who needs to hold onto dirt if you have no farming mods?

Hardcoding it is easy, though a bit slow. Iterating through the register_plants table for each and every item as you are trying to move into the container is much, much slower than just checking that it's in an appropriate group. Allowing all items named farming:* works, and is sufficiently fast, but allows pots, pans, cutting boards, juicers, bean poles, etc., plus all the finished products, which kind of defeats the purpose of having an early, cheap bag specifically for seeds.

So the plan is to iterate through the table once at load time, adding groups to items as appropriate. I was just interested in knowing if there was anything on the back burner such that if you decided to add groups for seeds and such, like Clyde did, this would overwrite your group assignments and cause problems. We would code for that now, rather than worry about it being a future compatibility and maintenance issue.

User avatar
TenPlus1
Member
Posts: 2886
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Updated to version 1.43

by TenPlus1 » Post

- Scythe works on use instead of right-click.
- Added {seed=2} group to plantable food items.

ThorfinnS
Member
Posts: 280
Joined: Mon Feb 25, 2019 22:05
GitHub: ThorfinnS

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

by ThorfinnS » Post

Awesome.

I'll grab it before he shows up to the computer lab this afternoon.

Thanks!

ThorfinnS
Member
Posts: 280
Joined: Mon Feb 25, 2019 22:05
GitHub: ThorfinnS

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

by ThorfinnS » Post

For some reason, I cannot make a fork from notabug onto github. Pretty sure I've done it before. Or maybe I cloned it locally then pushed it to a newly created github. Have to look into it some day when I have a better connection. Upshot is I can't do a PR.

Anyway, ran into an issue with earthbuild where changing the modlist would make either this or earthbuild load last, and consequently overwrite the others' drops. Rewrote grass.lua and earthbuild's farming.lua to use your function to add drops to an existing node.

And for whatever reason I can't attach the grass.lua. What's the typical workaround? Delete the extension, use a different extension, zip?

Code: Select all

minetest.log(minetest.get_current_modname())

local function add_drop(nodename, drop_table)

	-- does node exist?
	if not minetest.registered_nodes[nodename] then return end

	-- get existing drops
	local drops = minetest.registered_nodes[nodename].drop

	-- if single item string then apend to end of new drop_table
	if type(drops) == "string" then print ("== string")

		table.insert(drop_table.items, {items = {drops}})
	elseif type(drops) == "table" then print ("== table")

		-- apend existing drops to new drop_table
		for _, item in ipairs(drops.items) do
			table.insert(drop_table.items, item)
		end

		-- use new max_items or default to current
		drop_table.max_items = drop_table.max_items or drops.max_items
	end

	-- override node with new drops
	minetest.override_item(nodename, {drop = drop_table})
end


for i = 4, 5 do

	-- Override default grass and have it drop Wheat Seeds
	if not minetest.registered_nodes["default:grass_" .. i].drop.items then
		add_drop("default:grass_" .. i, {
			max_items = 1,
			items = {{items = {"farming:seed_wheat"}, rarity = 5}}
		})
	end

-- add farming redo crop
	add_drop("default:grass_" .. i, {
		items = {
			{items = {"farming:seed_oat"}, rarity = 5}
		}})
	-- minetest.log("default:grass_"..i)
	-- minetest.log(dump(minetest.registered_nodes["default:grass_"..i].drop))


	-- Override default dry grass and have it drop Barley Seeds
	if not minetest.registered_nodes["default:dry_grass_" .. i].drop.items then
		add_drop("default:dry_grass_" .. i, {
			max_items = 1,
			items = {{items = {"farming:seed_barley"}, rarity = 5}}
		})
	end

-- add farming redo crop
	add_drop("default:dry_grass_" .. i, {
		items = {
			{items = {"farming:seed_rye"}, rarity = 5},
		}
	})
	-- minetest.log("default:dry_grass_"..i)
	-- minetest.log(dump(minetest.registered_nodes["default:dry_grass_"..i].drop))

end


-- Override default Jungle Grass and have it drop Cotton Seeds
if minetest.registered_nodes["default:junglegrass"].drop == nil then
	add_drop("default:junglegrass", {
	max_items = 1,
	items = {
		{items = {"farming:seed_cotton"}, rarity = 8},
		{items = {"default:junglegrass"}}
	}
})
end

-- add farming redo crop
add_drop("default:junglegrass", {
	items = {
		{items = {"farming:seed_rice"}, rarity = 8},
	}
})
	-- minetest.log("default:junglegrass")
	-- minetest.log(dump(minetest.registered_nodes["default:junglegrass"].drop))

Emerald
Member
Posts: 30
Joined: Sat Feb 02, 2019 02:41
IRC: Emerald2
In-game: Emerald2

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

by Emerald » Post

Most of the savannah is now default:dry_dirt_with_dry_grass. Will there be an update so that coffee and pineapple spawns on those too?

Segmented Worm
Member
Posts: 21
Joined: Mon Oct 07, 2019 23:12

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

by Segmented Worm » Post

After replanting rice several times, it has stopped growing.

User avatar
TenPlus1
Member
Posts: 2886
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

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

by TenPlus1 » Post

@Emerald - I've added initial compatibility for new dry dirt nodes so that the pineapple and coffee grow on those nodes, also so that they can be hoe'd into normal soil.

Segmented Worm
Member
Posts: 21
Joined: Mon Oct 07, 2019 23:12

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

by Segmented Worm » Post

Segmented Worm wrote:After replanting rice several times, it has stopped growing.
Never mind, I thought they would grow from torches :-|

User avatar
TenPlus1
Member
Posts: 2886
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Updated to version 1.44

by TenPlus1 » Post

- Mithril Scythe now works using right-click instead of left to harvest crops.
- Seed group added to plantable items {seed=1} for seeds, {seed=2} for food items.
- Added 'farming_stage_length' setting to adjust speed of crop growth (detault: 160 secs).

User avatar
TenPlus1
Member
Posts: 2886
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Updated to version 1.45

by TenPlus1 » Post

- Hoes and Soil more inline with default wet/dry/base option
- Added dry_dirt soil it 5.x detected
- Translations updated, French added

User avatar
TenPlus1
Member
Posts: 2886
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Update:

by TenPlus1 » Post

- Added Mint and Mint Tea (thanks Darkstalker for textures)
- Added Cactus Juice with 1 in 5 chance of poisoning (thanks OgelGames)
- Added Pasta and Spaghetti

User avatar
TenPlus1
Member
Posts: 2886
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Update:

by TenPlus1 » Post

- Added Cabbage and crop
- Added Korean Bibimbap (skillet, bowl, chicken, carrot, egg, cabbage)
- If mobs_animal not active recipe is (skilled, bowl, carrot, cabbage, 2x mushroom, rice)
- Rhubarb doesn't like it too bright when growing
- Code tweak and tidy

Note: Bonemeal and Ethereal mods updated to use cabbage also :)

Gundul
Member
Posts: 1078
Joined: Thu Aug 27, 2015 10:55
GitHub: berengma
IRC: Gundul
Location: Europe/Asia

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

by Gundul » Post

While searching for groups I found this typo in cabbage.lua:

Code: Select all

farming.registered_plants["farming:cabbage"] = {
	crop = "farming:cababge",
	seed = "farming:cabbage",
	minlight = 13,
	maxlight = 15,
	steps = 6
}
I do not know if that is important, but I guess it should be crop="farming:cabbage" :)
My servers: Jungle, Lilly in the valley

User avatar
TenPlus1
Member
Posts: 2886
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

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

by TenPlus1 » Post

Well spotted Gundul, fixed and git updated :) thanks...

User avatar
T6C
Member
Posts: 59
Joined: Thu May 07, 2020 17:11
In-game: T6C

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

by T6C » Post

I haven't seen someone ask this yet (granted, there are 19 pages of posts spanning 6 years, and I haven't read them all). Is there some sort of guide for this Farming Redo mod? For example, how many stages does rice grow through before it's "ripe?" What crafting recipes use rice, and how? Stuff like that. I've tried using the Crafting Guide mod, but apparently that isn't compatible with v5.2.0, and that's the latest version on the buster-backports repository.

I really like the Minetest wiki that goes into detail about almost everything you can do with any block. Several mods' info are in there, too, just not Farming Redo.

User avatar
twoelk
Member
Posts: 1400
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

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

by twoelk » Post

guess it's somewhat outdated but try https://wiki.minetest.net/Mods/Farming_Redo for some basics.

yep rice is missing.

sigh

User avatar
micu
Member
Posts: 31
Joined: Fri Oct 19, 2018 07:50
GitHub: realmicu

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

by micu » Post

Hello TenPlus1,

I've stumbled upon a minor issue when using digtron as harvester machine. Apparently soil sometimes gets changed to normal one under digtron, so if that machine also replants crops it may fail for some areas. It happens when ABM for soil node fires when digtron moves over it.
My quick fix for this is to exclude all digtron nodes from changing soil back to dirt:

Code: Select all

diff --git a/soil.lua b/soil.lua
index ab8be15..6438644 100644
--- a/soil.lua
+++ b/soil.lua
@@ -147,7 +147,8 @@ minetest.register_abm({
 		-- what's on top of soil, if solid/not plant change soil to dirt
 		if minetest.registered_nodes[nn]
 		and minetest.registered_nodes[nn].walkable
-		and minetest.get_item_group(nn, "plant") == 0 then
+		and minetest.get_item_group(nn, "plant") == 0
+		and minetest.get_item_group(nn, "digtron") == 0 then
 			minetest.set_node(pos, {name = "default:dirt"})
 			return
 		end
It works for all digtron nodes except crates and replicator (these are not in "digtron" group, but are also not movable machine components anyway).

Cheers
Micu

User avatar
T6C
Member
Posts: 59
Joined: Thu May 07, 2020 17:11
In-game: T6C

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

by T6C » Post

w00t! v5.3.0 was pushed to the Debian repositories! :D I can use the crafting guide now.

This may seem like a stupid question, but I can't for the life of me figure out how to farm cabbage. I have a head of cabbage, but when I plant it, it grows...1 head of cabbage...which I then need to replant... O_o? What am I doing wrong?

User avatar
TenPlus1
Member
Posts: 2886
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

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

by TenPlus1 » Post

@T6C - Cabbages give a 1 in 5 chance of giving out 2x cabbages, and if you use the mithril scythe it will harvest and replant a new cabbage effectively giving you a chance of 3 in total :)

Sokomine
Member
Posts: 4170
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

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

by Sokomine » Post

TenPlus1 wrote: @T6C - Cabbages give a 1 in 5 chance of giving out 2x cabbages, and if you use the mithril scythe it will harvest and replant a new cabbage effectively giving you a chance of 3 in total :)
Ah. A use for the mithril scythe. Still...cabbage isn't such an expensive..thing...in RL. Can't be that difficult to grow it?
A list of my mods can be found here.

User avatar
T6C
Member
Posts: 59
Joined: Thu May 07, 2020 17:11
In-game: T6C

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

by T6C » Post

TenPlus1 wrote:
Sat Aug 15, 2020 19:49
@T6C - Cabbages give a 1 in 5 chance of giving out 2x cabbages, and if you use the mithril scythe it will harvest and replant a new cabbage effectively giving you a chance of 3 in total :)
So, what you're telling me is I need to dig a deeper mine to get mithril. XD My y = -270 mine ain't gonna cut it. Until I get mithril, I'll just keep working on that 20% chance of more cabbage.

More cabbage = MOAR BIBIMBAP! ^_^;

Post Reply

Who is online

Users browsing this forum: Google [Bot], insomniac and 7 guests