mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-07-17 23:20:23 +02:00
added refill for cocoa and fix bug
This commit is contained in:
@ -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
|
||||
@ -173,4 +182,4 @@ minetest.register_abm({
|
||||
})
|
||||
end
|
||||
end,
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user