From a14fc6f3ad0a802dd7e6da71da06cba37a9fb23b Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Sat, 29 Aug 2015 09:27:01 +0100 Subject: Added auto-refill routine and fixed a few bugs --- cocoa.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cocoa.lua') diff --git a/cocoa.lua b/cocoa.lua index c68a0d3..26adc68 100644 --- a/cocoa.lua +++ b/cocoa.lua @@ -25,6 +25,15 @@ function place_cocoa(itemstack, placer, pointed_thing, plantname) minetest.add_node(pt.above, {name = plantname}) if not minetest.setting_getbool("creative_mode") then itemstack:take_item() + -- check for refill + if itemstack:get_count() == 0 then + minetest.after(0.20, + farming.refill_plant, + placer, + "farming:cocoa_beans", + placer:get_wield_index() + ) + end -- END refill end return itemstack end -- cgit v1.2.3