mirror of
https://github.com/pandorabox-io/banners.git
synced 2025-01-06 16:10:32 +01:00
fix banners not being protected
This commit is contained in:
parent
a6b1a280b4
commit
ef8cf57941
9
init.lua
9
init.lua
@ -159,11 +159,12 @@ banners.banner_on_use = function(itemstack, player, pointed_thing)
|
||||
end
|
||||
|
||||
banners.banner_on_dig = function(pos, node, player)
|
||||
if not player or minetest.is_protected(pos, player:get_player_name()) then
|
||||
return
|
||||
end
|
||||
local meta = minetest.get_meta(pos)
|
||||
if player then
|
||||
local inventory = player:get_inventory()
|
||||
inventory:add_item("main", {name=node.name, count=1, wear=0, metadata=meta:get_string("banner")})
|
||||
end
|
||||
local inventory = player:get_inventory()
|
||||
inventory:add_item("main", {name=node.name, count=1, wear=0, metadata=meta:get_string("banner")})
|
||||
minetest.remove_node(pos)
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user