1
0
Fork 0

Merge pull request 'Disable beehive/nest drops in creative' (#3450) from beehive_drops_creative into master

Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/3450
Reviewed-by: 𝕵𝖔𝖍𝖆𝖓𝖓𝖊𝖘 𝕱𝖗𝖎𝖙𝖟 <mrrar@noreply.git.minetest.land>
damage
PrairieWind 2023-03-03 23:11:42 +00:00
commit cfaa6aa8c2
1 changed files with 16 additions and 7 deletions

View File

@ -48,16 +48,25 @@ 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
minetest.add_item(pos, "mcl_beehives:beehive") if not is_creative then
if not silk_touch and not is_creative then mcl_util.deal_damage(digger, 10) end 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") and not inv:contains_item("main", "mcl_beehives:beehive") then
inv:add_item("main", "mcl_beehives:beehive")
end
elseif beenest then elseif beenest then
if silk_touch or 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")
else awards.unlock(digger:get_player_name(), "mcl:total_beelocation")
mcl_util.deal_damage(digger, 10) 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")
end end
end end
end end