diff --git a/README.md b/README.md index e353550..fae4769 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Change log: - 3.0 - Added PlayerFactions support, 'protector_hud_interval' setting and listing in advanced settings for mod values. - 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.3 - Added support for playerfactions new api (thanks louisroyer) +- 3.3 - Added support for playerfactions new api (thanks louisroyer), added limiter to protection radius of 22. Lucky Blocks: 10 diff --git a/hud.lua b/hud.lua index 9b78afa..e33901e 100644 --- a/hud.lua +++ b/hud.lua @@ -1,6 +1,10 @@ local S = protector.intllib local radius = (tonumber(minetest.setting_get("protector_radius")) or 5) + +-- radius limiter (minetest cannot handle node volume of more than 4096000) +if radius > 22 then radius = 22 end + local hud = {} local hud_timer = 0 local hud_interval = (tonumber(minetest.setting_get("protector_hud_interval")) or 5) diff --git a/init.lua b/init.lua index 3cb1ca3..7e0f76c 100644 --- a/init.lua +++ b/init.lua @@ -34,6 +34,10 @@ local protector_show = tonumber(minetest.settings:get("protector_show_interval") local protector_recipe = minetest.settings:get_bool("protector_recipe") ~= false local protector_msg = minetest.settings:get_bool("protector_msg") ~= false +-- radius limiter (minetest cannot handle node volume of more than 4096000) +if protector_radius > 22 then protector_radius = 22 end + + -- get static spawn position local statspawn = minetest.string_to_pos(minetest.settings:get("static_spawnpoint")) or {x = 0, y = 2, z = 0} diff --git a/settingtypes.txt b/settingtypes.txt index aea796b..7fe8446 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -1,5 +1,5 @@ # Size of protected area around protection node limiting player interaction -protector_radius (Protector Radius) int 5 +protector_radius (Protector Radius [max 22]) int 5 # Flips player around when accessing protected area to stop lag griefing protector_flip (Protector Flip) bool false diff --git a/tool.lua b/tool.lua index a102dac..14570a6 100644 --- a/tool.lua +++ b/tool.lua @@ -6,6 +6,9 @@ local S = protector.intllib -- get protection radius local r = tonumber(minetest.settings:get("protector_radius")) or 5 +-- radius limiter (minetest cannot handle node volume of more than 4096000) +if r > 22 then r = 22 end + minetest.register_craftitem("protector:tool", { description = S("Protector Placer Tool (stand near protector, face direction and use)"), inventory_image = "protector_display.png^protector_logo.png",