summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortenplus1 <tenplus1@users.noreply.github.com>2018-06-17 09:59:20 +0100
committerGitHub <noreply@github.com>2018-06-17 09:59:20 +0100
commit021fd4b1e74fe09a983f51670f27a59efec0801c (patch)
tree4ae6c0fbc1e1327dd86f24aac7b25a808701030f
parent9a749598c0b8311435a091a00d71a5fd54fbc45b (diff)
Update cocoa.lua
add growth_check(pos, nodename) function
-rw-r--r--crops/cocoa.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/crops/cocoa.lua b/crops/cocoa.lua
index 71d038e..1510b3a 100644
--- a/crops/cocoa.lua
+++ b/crops/cocoa.lua
@@ -124,7 +124,13 @@ local crop_def = {
snappy = 3, flammable = 2, plant = 1, growing = 1,
not_in_creative_inventory=1, leafdecay = 1, leafdecay_drop = 1
},
- sounds = default.node_sound_leaves_defaults()
+ sounds = default.node_sound_leaves_defaults(),
+ growth_check = function(pos, node_name)
+ if minetest.find_node_near(pos, 1, {"default:jungletree"}) then
+ return false
+ end
+ return true
+ end,
}
-- stage 1
@@ -146,6 +152,7 @@ minetest.register_node("farming:cocoa_3", table.copy(crop_def))
-- stage 4 (final)
crop_def.tiles = {"farming_cocoa_4.png"}
crop_def.groups.growing = 0
+crop_def.growth_check = nil
crop_def.drop = {
items = {
{items = {'farming:cocoa_beans 2'}, rarity = 1},