update
This commit is contained in:
parent
329d48d26d
commit
aee6b25cdd
2 changed files with 48 additions and 43 deletions
|
@ -61,6 +61,7 @@ Change log:
|
||||||
- 3.1 - Ability to hide protection blocks using /protector_hide and /protector_show , italian local added (thanks Hamlet)
|
- 3.1 - Ability to hide protection blocks using /protector_hide and /protector_show , italian local added (thanks Hamlet)
|
||||||
- 3.2 - Defaults to Minetest translation if found, otherwise intllib fallback if loaded, locale files updated for both. Added 'protector_msg' setting for player text.
|
- 3.2 - Defaults to Minetest translation if found, otherwise intllib fallback if loaded, locale files updated for both. Added 'protector_msg' setting for player text.
|
||||||
- 3.3 - Added support for playerfactions new api (thanks louisroyer), added limiter to protection radius of 22.
|
- 3.3 - Added support for playerfactions new api (thanks louisroyer), added limiter to protection radius of 22.
|
||||||
|
- 3.4 - Player flip and hurt functions moved to minetest.register_protection_violation function (thanks hlqkj)
|
||||||
|
|
||||||
Lucky Blocks: 10
|
Lucky Blocks: 10
|
||||||
|
|
||||||
|
|
|
@ -356,17 +356,10 @@ protector.can_dig = function(r, pos, digger, onlyowner, infolevel)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local old_is_protected = minetest.is_protected
|
-- add protector hurt and flip to protection violation function
|
||||||
|
minetest.register_on_protection_violation(function(pos, name)
|
||||||
|
|
||||||
-- check for protected area, return true if protected and digger isn't on list
|
local player = minetest.get_player_by_name(name)
|
||||||
function minetest.is_protected(pos, digger)
|
|
||||||
|
|
||||||
digger = digger or "" -- nil check
|
|
||||||
|
|
||||||
-- is area protected against digger?
|
|
||||||
if not protector.can_dig(protector_radius, pos, digger, false, 1) then
|
|
||||||
|
|
||||||
local player = minetest.get_player_by_name(digger)
|
|
||||||
|
|
||||||
if player and player:is_player() then
|
if player and player:is_player() then
|
||||||
|
|
||||||
|
@ -407,7 +400,18 @@ function minetest.is_protected(pos, digger)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
|
||||||
|
local old_is_protected = minetest.is_protected
|
||||||
|
|
||||||
|
-- check for protected area, return true if protected and digger isn't on list
|
||||||
|
function minetest.is_protected(pos, digger)
|
||||||
|
|
||||||
|
digger = digger or "" -- nil check
|
||||||
|
|
||||||
|
-- is area protected against digger?
|
||||||
|
if not protector.can_dig(protector_radius, pos, digger, false, 1) then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue