diff --git a/forestry_bees/apiary.lua b/forestry_bees/apiary.lua index fc83311..db06313 100644 --- a/forestry_bees/apiary.lua +++ b/forestry_bees/apiary.lua @@ -172,6 +172,8 @@ local function apiary_node_timer(pos,elapsed) local formspec local item_state local queen_percent = 0 + --by default timer doesnt restart + local result = false if actionable then queen_percent = math.floor(src_time / breedtime * 100) if dst_full then @@ -179,6 +181,8 @@ local function apiary_node_timer(pos,elapsed) else item_state = tostring(item_percent).."%" end + --make sure timer restarts + result = true else if (monarchlist and not monarchlist[1]:is_empty()) or (dronelist and not dronelist[1]:is_empty()) then item_state = "Cannot breed" @@ -186,14 +190,12 @@ local function apiary_node_timer(pos,elapsed) item_state = "Empty" end end - local result = false + formspec = forestry_bees.get_apiary_active_formspec(queen_percent) - --make sure timer restarts - result = true meta:set_float("src_time", src_time) meta:set_string("formspec", formspec) - + minetest.chat_send_all(tostring(math.random())) return result end