mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-29 22:11:10 +01:00
Make banners drop when support node is dug and when banner node is dug
This commit is contained in:
parent
acfcb7528c
commit
9c83755f53
1 changed files with 8 additions and 8 deletions
|
@ -113,14 +113,6 @@ local function on_dig_banner(pos, node, digger)
|
||||||
minetest.record_protection_violation(pos, name)
|
minetest.record_protection_violation(pos, name)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
-- Drop item
|
|
||||||
local meta = minetest.get_meta(pos)
|
|
||||||
local item = meta:get_inventory():get_stack("banner", 1)
|
|
||||||
if not item:is_empty() then
|
|
||||||
minetest.handle_node_drops(pos, {item:to_string()}, digger)
|
|
||||||
else
|
|
||||||
minetest.handle_node_drops(pos, {"mcl_banners:banner_item_white"}, digger)
|
|
||||||
end
|
|
||||||
-- Remove node
|
-- Remove node
|
||||||
minetest.remove_node(pos)
|
minetest.remove_node(pos)
|
||||||
end
|
end
|
||||||
|
@ -141,6 +133,14 @@ local function on_destruct_banner(pos, hanging)
|
||||||
local ent = v:get_luaentity()
|
local ent = v:get_luaentity()
|
||||||
if ent and ent.name == nodename then
|
if ent and ent.name == nodename then
|
||||||
v:remove()
|
v:remove()
|
||||||
|
-- Drop item
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
local item = meta:get_inventory():get_stack("banner", 1)
|
||||||
|
if not item:is_empty() then
|
||||||
|
minetest.handle_node_drops(pos, {item:to_string()}, digger)
|
||||||
|
else
|
||||||
|
minetest.handle_node_drops(pos, {"mcl_banners:banner_item_white"}, digger)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue