forestry/forestry_bees/helper.lua

21 lines
662 B
Lua
Raw Normal View History

2024-10-07 14:31:20 +02:00
function forestry_bees.Bee(bee_type,active_gene,inactive_gene)
local itemstack = ItemStack({name = forestry_bees.bee_name(bee_type,active_gene)})
itemstack:get_meta():set_string("active_gene",active_gene)
itemstack:get_meta():set_string("inactive_gene",inactive_gene)
return itemstack
end
function forestry_bees.bee_name(bee_type,active_gene)
return "forestry_bees:"..active_gene.."_"..bee_type
end
function forestry_bees.stacks_in_inv(inv,listname)
local stack_list = inv:get_list(listname)
local result = 0
for i = 1,#stack_list do
if not stack_list[i]:is_empty() then
result = result + 1
end
end
return result
end