Beehives only go into inventory in creative when no beehive exists in the inventory
parent
c71aec6f9d
commit
2f10a8767b
|
@ -54,17 +54,19 @@ local dig_hive = function(pos, node, oldmetadata, digger)
|
||||||
if not is_creative then
|
if not is_creative then
|
||||||
minetest.add_item(pos, "mcl_beehives:beehive")
|
minetest.add_item(pos, "mcl_beehives:beehive")
|
||||||
if not silk_touch then mcl_util.deal_damage(digger, 10) end
|
if not silk_touch then mcl_util.deal_damage(digger, 10) end
|
||||||
elseif is_creative and inv:room_for_item("main", "mcl_beehives:beehive") then
|
elseif is_creative and inv:room_for_item("main", "mcl_beehives:beehive") and not inv:contains_item("main", "mcl_beehives:beehive") then
|
||||||
inv:add_item("main", "mcl_beehives:beehive")
|
inv:add_item("main", "mcl_beehives:beehive")
|
||||||
end
|
end
|
||||||
elseif beenest then
|
elseif beenest then
|
||||||
if silk_touch and not is_creative then
|
if not is_creative then
|
||||||
minetest.add_item(pos, "mcl_beehives:bee_nest")
|
if silk_touch then
|
||||||
awards.unlock(digger:get_player_name(), "mcl:total_beelocation")
|
minetest.add_item(pos, "mcl_beehives:bee_nest")
|
||||||
elseif is_creative and inv:room_for_item("main", "mcl_beehives:bee_nest") then
|
awards.unlock(digger:get_player_name(), "mcl:total_beelocation")
|
||||||
|
else
|
||||||
|
mcl_util.deal_damage(digger, 10)
|
||||||
|
end
|
||||||
|
elseif is_creative and inv:room_for_item("main", "mcl_beehives:bee_nest") and not inv:contains_item("main", "mcl_beehives:bee_nest") then
|
||||||
inv:add_item("main", "mcl_beehives:bee_nest")
|
inv:add_item("main", "mcl_beehives:bee_nest")
|
||||||
else
|
|
||||||
mcl_util.deal_damage(digger, 10)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue