2 Achegas af48a0e661 ... b6ba098396

Autor SHA1 Mensaxe Data
  tenplus1 b6ba098396 revert on_grow change hai 1 ano
  tenplus1 0f25366203 add return growth hai 1 ano
Modificáronse 1 ficheiros con 2 adicións e 15 borrados
  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