forked from VoxeLibre/VoxeLibre
Add beehives and bee nests to inventory in creative
This commit is contained in:
parent
d97a09181f
commit
f4d0c985af
|
@ -48,16 +48,21 @@ local dig_hive = function(pos, node, oldmetadata, digger)
|
||||||
local beenest = string.find(node.name, "mcl_beehives:bee_nest")
|
local beenest = string.find(node.name, "mcl_beehives:bee_nest")
|
||||||
local silk_touch = mcl_enchanting.has_enchantment(wield_item, "silk_touch")
|
local silk_touch = mcl_enchanting.has_enchantment(wield_item, "silk_touch")
|
||||||
local is_creative = minetest.is_creative_enabled(digger:get_player_name())
|
local is_creative = minetest.is_creative_enabled(digger:get_player_name())
|
||||||
|
local inv = digger:get_inventory()
|
||||||
|
|
||||||
if beehive then
|
if beehive then
|
||||||
if not silk_touch and not is_creative then
|
if not is_creative then
|
||||||
mcl_util.deal_damage(digger, 10)
|
|
||||||
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
|
||||||
|
elseif is_creative and inv:room_for_item("main", "mcl_beehives:beehive") then
|
||||||
|
inv:add_item("main", "mcl_beehives:beehive")
|
||||||
end
|
end
|
||||||
elseif beenest then
|
elseif beenest then
|
||||||
if silk_touch and not is_creative then
|
if silk_touch and not is_creative then
|
||||||
minetest.add_item(pos, "mcl_beehives:bee_nest")
|
minetest.add_item(pos, "mcl_beehives:bee_nest")
|
||||||
awards.unlock(digger:get_player_name(), "mcl:total_beelocation")
|
awards.unlock(digger:get_player_name(), "mcl:total_beelocation")
|
||||||
|
elseif is_creative and inv:room_for_item("main", "mcl_beehives:bee_nest") then
|
||||||
|
inv:add_item("main", "mcl_beehives:bee_nest")
|
||||||
else
|
else
|
||||||
mcl_util.deal_damage(digger, 10)
|
mcl_util.deal_damage(digger, 10)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue