diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2018-06-17 09:55:26 +0100 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2018-06-17 09:55:26 +0100 |
commit | 8a4ca846d90abf5732b436c1f31b72c6b52e61dc (patch) | |
tree | b5d7ba913649ec5b95e40a5cedac717e92eea225 /crops/cocoa.lua | |
parent | 9d6728053aa2138e1fc77938ec4c34f89ba29542 (diff) |
added growth_check(pos, nodename) function
Diffstat (limited to 'crops/cocoa.lua')
-rw-r--r-- | crops/cocoa.lua | 9 |
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}, |