summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortenplus1 <tenplus1@users.noreply.github.com>2018-06-17 09:58:06 +0100
committerGitHub <noreply@github.com>2018-06-17 09:58:06 +0100
commit9a749598c0b8311435a091a00d71a5fd54fbc45b (patch)
treec0c9584aa1d1ee59e6869ac4fe12b10bb421e05e
parent039a06299ef4d283afcb62baac1e17f5e31083a5 (diff)
Update init.lua
add growth_check function(pos, nodename)
-rw-r--r--init.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/init.lua b/init.lua
index 8baf53e..8c92ce7 100644
--- a/init.lua
+++ b/init.lua
@@ -7,7 +7,7 @@
farming = {}
farming.mod = "redo"
-farming.version = "20180609"
+farming.version = "20180617"
farming.path = minetest.get_modpath("farming")
farming.select = {
type = "fixed",
@@ -301,11 +301,16 @@ function farming.plant_growth_timer(pos, elapsed, node_name)
return false
end
- if stages.plant_name == "farming:cocoa" then
+ -- custom growth check
+ local chk = minetest.registered_nodes[node_name].growth_check
- if not minetest.find_node_near(pos, 1, {"default:jungletree"}) then
+ if chk then
+
+ if chk(pos, node_name) then
return true
end
+
+ -- otherwise check for wet soil beneath crop
else
local under = minetest.get_node({ x = pos.x, y = pos.y - 1, z = pos.z })