2 Commits af48a0e661 ... b6ba098396

Author SHA1 Message Date
  tenplus1 b6ba098396 revert on_grow change 1 year ago
  tenplus1 0f25366203 add return growth 1 year ago
1 changed files with 2 additions and 15 deletions
  1. 2 15
      init.lua

+ 2 - 15
init.lua

@@ -332,15 +332,6 @@ minetest.register_abm({
 })
 
 
-function farming.classic_growth(pos, next_stage)
-
-	local p2 = minetest.registered_nodes[next_stage].place_param2 or 1
-
-	minetest.swap_node(pos, {name = next_stage, param2 = p2})
-end
-
-
 -- Plant timer function that grows plants under the right conditions.
 function farming.plant_growth_timer(pos, elapsed, node_name)
 
@@ -422,14 +413,9 @@ function farming.plant_growth_timer(pos, elapsed, node_name)
 
 	if minetest.registered_nodes[stages.stages_left[growth]] then
 
-		-- Custom grow function
-		local on_grow = minetest.registered_nodes[node_name].on_grow
+		local p2 = minetest.registered_nodes[stages.stages_left[growth] ].place_param2 or 1
 
-		if on_grow then
-			on_grow(pos, stages.stages_left[growth])
-		else
-			farming.classic_growth(pos, stages.stages_left[growth])
-		end
+		minetest.swap_node(pos, {name = stages.stages_left[growth], param2 = p2})
 	else
 		return true
 	end