added simple protection check
parent
dc7ee11594
commit
99b721d4a0
9
api.lua
9
api.lua
|
@ -191,3 +191,12 @@ function pvp_block.register_on_punchplayer(player, hitter, time_from_last_punch,
|
|||
end
|
||||
|
||||
minetest.register_on_punchplayer(pvp_block.register_on_punchplayer)
|
||||
|
||||
-- protection
|
||||
local old_is_protected = minetest.is_protected
|
||||
function minetest.is_protected(pos, name)
|
||||
if pvp_block:in_area(pos) then
|
||||
return true
|
||||
end
|
||||
return old_is_protected(pos, name)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue