From d79107af6778eba616d4239062b4e712e92cc041 Mon Sep 17 00:00:00 2001 From: ssdaniel24 Date: Mon, 17 Jun 2024 17:49:18 +0300 Subject: [PATCH] Fixed review remarks --- mods/farming/api.lua | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/mods/farming/api.lua b/mods/farming/api.lua index 7133d7e8..08ab0a0a 100644 --- a/mods/farming/api.lua +++ b/mods/farming/api.lua @@ -191,11 +191,8 @@ end -- check if on wet soil farming.can_grow = function(pos) - local below = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}) - if minetest.get_item_group(below.name, "soil") < 3 then - return false - end - return true + local below = minetest.get_node(pos:offset(0, -1, 0)) + return minetest.get_item_group(below.name, "soil") >= 3 end farming.grow_plant = function(pos, elapsed) @@ -233,7 +230,7 @@ farming.grow_plant = function(pos, elapsed) return end - if (def.can_grow and def.can_grow(pos)) or (not def.can_grow and not farming.can_grow(pos)) then + if not (def.can_grow or farming.can_grow)(pos) then tick_again(pos) return end