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