Page 12 of 14

Re: [Mod] Farming Plus [farming_plus]

Posted: Sat Jul 05, 2014 20:52
by webdesigner97
lotek wrote:Farming Plus not compatible with Minetest Next Game

If I running the minetest next game together with farming plus mod (always latest dev from git) I can't plant wheat (seed).. it's get removed after a few (milli)seconds. detail description are on the mintetest next game topic, see here viewtopic.php?f=15&t=9066&p=147230#p147230

Does anybody knows how to fix it? Thanx for any help.
My first guess would be conflicting ABMs.
Edit: Just saw BlockMen's comment. Ignore my idea ;)

Re: [Mod] Farming Plus [farming_plus]

Posted: Mon Jul 07, 2014 21:38
by RebelD
Hi Adam and others.
Euhm I had a question, I'm using this mod for a few days now and I encountered something small and I wondered if it just occurs to me.

You see, when I harvest the stuff, it doesn't stack up. It just stays 1. So I need to run to a chest, put the item in it, then run back to harvest another one and keep repeating that.
Is this normal or am I the only one with this?

Re: [Mod] Farming Plus [farming_plus]

Posted: Tue Jul 08, 2014 11:16
by markbe
I'm trying to get string so I can craft a bow. Now when I harvest cotton, I get cotton and seed. It can be crafted into wool but not used as string in a bow. Must be a change with the default farming?

Any idea if string is still able to be gathered?

minetest-0.4.10-dev-win64-e69d660784
PilzAdam-farming_plus-94c261b
PilzAdam-throwing-90bcf43

p.s had to modify init.lua line 213 in farming_plus as below to allow planting due to change in default farming
function farming.place_seed(itemstack, placer, pointed_thing, plantname)

Re: [Mod] Farming Plus [farming_plus]

Posted: Tue Jul 08, 2014 19:24
by webdesigner97
markbe wrote:I'm trying to get string so I can craft a bow. Now when I harvest cotton, I get cotton and seed. It can be crafted into wool but not used as string in a bow. Must be a change with the default farming?

Any idea if string is still able to be gathered?

minetest-0.4.10-dev-win64-e69d660784
PilzAdam-farming_plus-94c261b
PilzAdam-throwing-90bcf43

p.s had to modify init.lua line 213 in farming_plus as below to allow planting due to change in default farming
function farming.place_seed(itemstack, placer, pointed_thing, plantname)
If I remember correctly, the string item was renamed...

Re: [Mod] Farming Plus [farming_plus]

Posted: Tue Jul 08, 2014 20:23
by lotek
@markbe could you post your changes, if I change only the function, then the seed get placed above the block... (well it works, but looks ugly).

Re: [Mod] Farming Plus [farming_plus]

Posted: Wed Jul 09, 2014 00:36
by markbe
I only changed the one line and got the same results as you did ... seed gets placed above but at least it grows. I don't know enough to fix properly; my change was just a work-around until someone who knew stuff did some testing and uploaded an update

Re: [Mod] Farming Plus [farming_plus]

Posted: Mon Jul 21, 2014 16:17
by lotek
*bump*

IMHO it doesn't work at all. if you change only the function "function farming.place_seed(itemstack, placer, pointed_thing, plantname)" then wheat from farming works again, but farming plus element's can not get seeded anymore.

I plea for a fix, that farming plus gets compatible with minetest 0.4.10 (to the new integrated default game), thanks :-)

Re: [Mod] Farming Plus [farming_plus]

Posted: Mon Jul 21, 2014 16:19
by Krock
lotek wrote:I plea for a fix, that farming plus gets compatible with minetest 0.4.10 (to the new integrated default game), thanks :-)
You also could use an other (sub-)game, where it works.

Re: [Mod] Farming Plus [farming_plus]

Posted: Tue Jul 22, 2014 13:53
by webdesigner97
Krock wrote:
lotek wrote:I plea for a fix, that farming plus gets compatible with minetest 0.4.10 (to the new integrated default game), thanks :-)
You also could use an other (sub-)game, where it works.
Maybe farming_plus should be merged with farming? The pros: More plants, and finally compatibility ^^

Re: [Mod] Farming Plus [farming_plus]

Posted: Wed Jul 23, 2014 14:09
by PilzAdam
lotek wrote:I plea for a fix, that farming plus gets compatible with minetest 0.4.10 (to the new integrated default game), thanks :-)
The minetest_game team needs to fix this, since it worked before they changed the farming API (for whatever reason).

Re: [Mod] Farming Plus [farming_plus]

Posted: Wed Jul 23, 2014 17:13
by lotek
Thanks for your answer.
PilzAdam wrote:
lotek wrote:I plea for a fix, that farming plus gets compatible with minetest 0.4.10 (to the new integrated default game), thanks :-)
The minetest_game team needs to fix this, since it worked before they changed the farming API (for whatever reason).
but @BlockMen from minetest_game told me the same :-(
Its easy fixable in farming_plus. The bug appears because farming_plus calls farming:place_seed() which causes trouble with the new API of farming in NeXt. If his mod would use farming.place_seed() it works fine. Ask PilzAdam to fix it ;)

viewtopic.php?f=15&t=9066&p=147230#p147230

Well I'm in no position to demand anything. But what I am supposed to do now? Bury the whole minetest_game crew in my backyard (six feet under) for changing the api :-p But honestly should not the mod follow the default game even if it's "not so nice"?

Re: [Mod] Farming Plus [farming_plus]

Posted: Sun Jul 27, 2014 15:53
by BlockMen
lotek wrote: [...]
But honestly should not the mod follow the default game even if it's "not so nice"?
Yes.
PilzAdam wrote: The minetest_game team needs to fix this, since it worked before they changed the farming API (for whatever reason).
No. Its your mod. If not able or willing to fix it should be moved to "Old mods", see viewtopic.php?f=13&t=2053

Re: [Mod] Farming Plus [farming_plus]

Posted: Sun Jul 27, 2014 19:48
by PilzAdam
BlockMen wrote:
PilzAdam wrote: The minetest_game team needs to fix this, since it worked before they changed the farming API (for whatever reason).
No. Its your mod. If not able or willing to fix it should be moved to "Old mods", see viewtopic.php?f=13&t=2053
I dont see anything about game compatibility there(?)

Re: [Mod] Farming Plus [farming_plus]

Posted: Sun Jul 27, 2014 20:07
by webdesigner97
PilzAdam wrote:
BlockMen wrote:
PilzAdam wrote: The minetest_game team needs to fix this, since it worked before they changed the farming API (for whatever reason).
No. Its your mod. If not able or willing to fix it should be moved to "Old mods", see viewtopic.php?f=13&t=2053
I dont see anything about game compatibility there(?)
I already thought about merging farming_plus into farming (at least important plants) to add more plants to minetest_game, but I don't have the time...

Re: [Mod] Farming Plus [farming_plus]

Posted: Mon Jul 28, 2014 19:29
by gsmanners
A while ago, I changed this in my own game to be a little nicer about placing plants. I don't know if it has problems, but I haven't seen any so far...

Code: Select all

--- ./farming_plus-old/carrots.lua	2013-11-03 14:19:44.000000000 -0700
+++ ./farming_plus-new/carrots.lua	2014-05-16 22:53:48.000000000 -0600
@@ -2,13 +2,7 @@
 	description = "Carrot Seeds",
 	inventory_image = "farming_carrot_seed.png",
 	on_place = function(itemstack, placer, pointed_thing)
-		local above = minetest.env:get_node(pointed_thing.above)
-		if above.name == "air" then
-			above.name = "farming_plus:carrot_1"
-			minetest.env:set_node(pointed_thing.above, above)
-			itemstack:take_item(1)
-			return itemstack
-		end
+		return farming:place_plant(itemstack, pointed_thing, "farming_plus:carrot_1")
 	end
 })
 
--- ./farming_plus-old/init.lua	2013-11-03 14:19:44.000000000 -0700
+++ ./farming_plus-new/init.lua	2014-05-16 22:54:57.000000000 -0600
@@ -1,6 +1,19 @@
 
 farming.registered_plants = {}
 
+function farming:place_plant(itemstack, pointed_thing, plant_name)
+	if pointed_thing.type == "node" then
+		local above = minetest.env:get_node(pointed_thing.above)
+		local under = minetest.env:get_node(pointed_thing.under)
+		if above.name == "air" and minetest.env:get_item_group(under.name, "soil") > 1 then
+			above.name = plant_name
+			minetest.env:set_node(pointed_thing.above, above)
+			itemstack:take_item(1)
+		end
+	end
+	return itemstack
+end
+
 function farming:add_plant(full_grown, names, interval, chance)
 	minetest.register_abm({
 		nodenames = names,
--- ./farming_plus-old/oranges.lua	2013-11-03 14:19:44.000000000 -0700
+++ ./farming_plus-new/oranges.lua	2014-05-16 22:53:56.000000000 -0600
@@ -2,13 +2,7 @@
 	description = "Orange Seeds",
 	inventory_image = "farming_orange_seed.png",
 	on_place = function(itemstack, placer, pointed_thing)
-		local above = minetest.env:get_node(pointed_thing.above)
-		if above.name == "air" then
-			above.name = "farming_plus:orange_1"
-			minetest.env:set_node(pointed_thing.above, above)
-			itemstack:take_item(1)
-			return itemstack
-		end
+		return farming:place_plant(itemstack, pointed_thing, "farming_plus:orange_1")
 	end
 })
 
--- ./farming_plus-old/potatoes.lua	2013-11-03 14:19:44.000000000 -0700
+++ ./farming_plus-new/potatoes.lua	2014-05-16 22:54:03.000000000 -0600
@@ -2,13 +2,7 @@
 	description = "Potato Seeds",
 	inventory_image = "farming_potato_seed.png",
 	on_place = function(itemstack, placer, pointed_thing)
-		local above = minetest.env:get_node(pointed_thing.above)
-		if above.name == "air" then
-			above.name = "farming_plus:potato_1"
-			minetest.env:set_node(pointed_thing.above, above)
-			itemstack:take_item(1)
-			return itemstack
-		end
+		return farming:place_plant(itemstack, pointed_thing, "farming_plus:potato_1")
 	end
 })
 
--- ./farming_plus-old/pumpkin.lua	2013-11-03 14:19:44.000000000 -0700
+++ ./farming_plus-new/pumpkin.lua	2014-05-16 22:53:36.000000000 -0600
@@ -2,13 +2,7 @@
 	description = "Pumpkin Seed",
 	inventory_image = "farming_pumpkin_seed.png",
 	on_place = function(itemstack, placer, pointed_thing)
-		local above = minetest.env:get_node(pointed_thing.above)
-		if above.name == "air" then
-			above.name = "farming:pumpkin_1"
-			minetest.env:set_node(pointed_thing.above, above)
-			itemstack:take_item(1)
-			return itemstack
-		end
+		return farming:place_plant(itemstack, pointed_thing, "farming:pumpkin_1")
 	end
 })
 
@@ -68,8 +62,7 @@
 		if tool and tool == "default:sword_wood" or tool == "default:sword_stone" or tool == "default:sword_steel" then
 			node.name = "farming:pumpkin_face"
 			minetest.env:set_node(pos, node)
-			puncher:get_inventory():add_item("main", ItemStack("farming:pumpkin_seed"))
-			if math.random(1, 5) == 1 then
+			for i=1, math.random(1, 5) do
 				puncher:get_inventory():add_item("main", ItemStack("farming:pumpkin_seed"))
 			end
 		end
--- ./farming_plus-old/rhubarb.lua	2013-11-03 14:19:44.000000000 -0700
+++ ./farming_plus-new/rhubarb.lua	2014-05-16 22:54:12.000000000 -0600
@@ -2,13 +2,7 @@
 	description = "Rhubarb Seeds",
 	inventory_image = "farming_rhubarb_seed.png",
 	on_place = function(itemstack, placer, pointed_thing)
-		local above = minetest.env:get_node(pointed_thing.above)
-		if above.name == "air" then
-			above.name = "farming_plus:rhubarb_1"
-			minetest.env:set_node(pointed_thing.above, above)
-			itemstack:take_item(1)
-			return itemstack
-		end
+		return farming:place_plant(itemstack, pointed_thing, "farming_plus:rhubarb_1")
 	end
 })
 
--- ./farming_plus-old/strawberries.lua	2013-11-03 14:19:44.000000000 -0700
+++ ./farming_plus-new/strawberries.lua	2014-05-16 22:54:19.000000000 -0600
@@ -2,13 +2,7 @@
 	description = "Strawberry Seeds",
 	inventory_image = "farming_strawberry_seed.png",
 	on_place = function(itemstack, placer, pointed_thing)
-		local above = minetest.env:get_node(pointed_thing.above)
-		if above.name == "air" then
-			above.name = "farming_plus:strawberry_1"
-			minetest.env:set_node(pointed_thing.above, above)
-			itemstack:take_item(1)
-			return itemstack
-		end
+		return farming:place_plant(itemstack, pointed_thing, "farming_plus:strawberry_1")
 	end
 })
 
--- ./farming_plus-old/tomatoes.lua	2013-11-03 14:19:44.000000000 -0700
+++ ./farming_plus-new/tomatoes.lua	2014-05-16 22:54:26.000000000 -0600
@@ -2,13 +2,7 @@
 	description = "Tomato Seeds",
 	inventory_image = "farming_tomato_seed.png",
 	on_place = function(itemstack, placer, pointed_thing)
-		local above = minetest.env:get_node(pointed_thing.above)
-		if above.name == "air" then
-			above.name = "farming_plus:tomato_1"
-			minetest.env:set_node(pointed_thing.above, above)
-			itemstack:take_item(1)
-			return itemstack
-		end
+		return farming:place_plant(itemstack, pointed_thing, "farming_plus:tomato_1")
 	end
 })

Re: [Mod] Farming Plus [farming_plus]

Posted: Wed Jul 30, 2014 11:37
by fireglow
Devs fighting over little things, meanwhile players are the ones suffering because (aspects of) the game appear to be broken. Nice.
Get over your egos and fix it, please.

Re: [Mod] Farming Plus [farming_plus]

Posted: Wed Jul 30, 2014 21:43
by crazyR
PilzAdam and BlockMen :

You are both official developers of minetest. so regardless of whether its the mod or the game that needs fixing the responsibility lie's on you. more so on PilzAdam due to it being your mod.

like fireglow said, all the fighting between you is ruining the game for everyone else, but then we should be used to it because it happens all to often on here, nearly every aspect of development hear is delayed due to silly bickering and fighting.

Please sort your differences out and find a fix one way or another.

Re: [Mod] Farming Plus [farming_plus]

Posted: Wed Jul 30, 2014 22:07
by swilde
FWIW, I ported farming plus to the new farming api for our server. The code can be found here:
http://hg.intevation.de/minetest/farming_plus_ng/

cheers,
sascha

Re: [Mod] Farming Plus [farming_plus]

Posted: Thu Jul 31, 2014 11:24
by BlockMen
fireglow wrote:Devs fighting over little things, meanwhile players are the ones suffering because (aspects of) the game appear to be broken. Nice.
Get over your egos and fix it, please.
Well, I'm definetly not responsible for fixing other peoples mods, but I can also understand that people want play with more farming-plants. So this is the only time I will do that.

Here a small fix, which everyone else could have done in 10 minutes: https://github.com/BlockMen/farming_plus

@PilzAdam, so you run your mod just with the engine and without any game?
@swilde, renaming everything is a bad idea in sense of Texture Pack support

Re: [Mod] Farming Plus [farming_plus]

Posted: Thu Jul 31, 2014 13:50
by ExeterDad
Thanks BlockMen, I fixed about 2/3 of my copy already, but your patch shows I missed some. Cheers to both of you :)

Re: [Mod] Farming Plus [farming_plus]

Posted: Fri Aug 01, 2014 19:04
by crazyR
thanks BlockMen

Re: [Mod] Farming Plus [farming_plus]

Posted: Mon Aug 04, 2014 01:36
by fireglow
Thank you, BlockMen :-)

Re: [Mod] Farming Plus [farming_plus]

Posted: Mon Aug 04, 2014 04:41
by 4aiman
Are you sure the soil is suitable for wheat?
The fact it disappears means that you didn't really plant anything.
Try any of the protection mods to see what I mean.

Re: [Mod] Farming Plus [farming_plus]

Posted: Fri Aug 15, 2014 08:41
by meldrian
+1 thx mate

Re: [Mod] Farming Plus [farming_plus]

Posted: Fri Aug 15, 2014 12:22
by Minetestforfun
Thank you blockmen, I had also this problem with wheat :)