From b56c002a97c28e6f2acafc969336537e4d00b27b Mon Sep 17 00:00:00 2001 From: jp Date: Fri, 21 Aug 2015 22:17:18 +0200 Subject: [PATCH] Limit honey stack to 16 --- hive.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hive.lua b/hive.lua index 9f0149e..de6c84e 100644 --- a/hive.lua +++ b/hive.lua @@ -50,12 +50,15 @@ minetest.register_abm({ action = function(pos, _, _, _) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() + local honeystack = inv:get_stack("honey", 1) + local honey = honeystack:get_count() local radius = 8 local minp = vector.add(pos, -radius) local maxp = vector.add(pos, radius) local flowers = minetest.find_nodes_in_area(minp, maxp, "group:flower") - if #flowers >= 4 then inv:add_item("honey", "xdecor:honey") end + if #flowers >= 4 and honey < 16 then + inv:add_item("honey", "xdecor:honey") end end })