Check protection for most nodes
This commit is contained in:
parent
bcf7125f9d
commit
312b17a958
18 changed files with 389 additions and 26 deletions
|
@ -60,7 +60,9 @@ end
|
|||
--
|
||||
|
||||
local function allow_metadata_inventory_put(pos, listname, index, stack, player)
|
||||
if minetest.is_protected(pos, player:get_player_name()) then
|
||||
local name = player:get_player_name()
|
||||
if minetest.is_protected(pos, name) then
|
||||
minetest.record_protection_violation(pos, name)
|
||||
return 0
|
||||
end
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
@ -111,7 +113,9 @@ local function allow_metadata_inventory_move(pos, from_list, from_index, to_list
|
|||
end
|
||||
|
||||
local function allow_metadata_inventory_take(pos, listname, index, stack, player)
|
||||
if minetest.is_protected(pos, player:get_player_name()) then
|
||||
local name = player:get_player_name()
|
||||
if minetest.is_protected(pos, name) then
|
||||
minetest.record_protection_violation(pos, name)
|
||||
return 0
|
||||
end
|
||||
return stack:get_count()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue