Update simple_protection mod to Git commit f1f85aa...

https://github.com/SmallJoker/simple_protection/tree/f1f85aa
This commit is contained in:
Jordan Irwin 2021-07-20 18:05:00 -07:00
parent 7b180f0c97
commit f8a653eefe
15 changed files with 331 additions and 366 deletions

View File

@ -123,7 +123,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
* [wardrobe][] ([MIT][lic.wardrobe]) -- version: [0500a78 Git][ver.wardrobe] *2021-06-08* * [wardrobe][] ([MIT][lic.wardrobe]) -- version: [0500a78 Git][ver.wardrobe] *2021-06-08*
* protection/ * protection/
* [pvp_areas][] ([LGPL][lic.lgpl2.1]) -- version: [6e4d66d Git][ver.pvp_areas] *2018-07-26* * [pvp_areas][] ([LGPL][lic.lgpl2.1]) -- version: [6e4d66d Git][ver.pvp_areas] *2018-07-26*
* [simple_protection][] ([CC0][lic.cc0]) -- version: [3630fe9 Git][ver.simple_protection] *2021-04-07* ([patched][patch.simple_protection]) * [simple_protection][] ([CC0][lic.cc0]) -- version: [f1f85aa Git][ver.simple_protection] *2021-07-18* ([patched][patch.simple_protection])
* storage/ * storage/
* [drawers][] ([MIT / CC0 / CC BY][lic.drawers]) -- version: [0.6.2][ver.drawers] *2021-03-27* * [drawers][] ([MIT / CC0 / CC BY][lic.drawers]) -- version: [0.6.2][ver.drawers] *2021-03-27*
* [more_chests][] ([GPL][lic.gpl2.0]) -- version: [6be8145 Git][ver.more_chests] *2021-04-05* * [more_chests][] ([GPL][lic.gpl2.0]) -- version: [6be8145 Git][ver.more_chests] *2021-04-05*
@ -666,7 +666,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
[ver.sfinv]: https://github.com/rubenwardy/sfinv/tree/556f70e [ver.sfinv]: https://github.com/rubenwardy/sfinv/tree/556f70e
[ver.sfinv_buttons]: http://repo.or.cz/minetest_sfinv_buttons.git/tree/ebb1f7c [ver.sfinv_buttons]: http://repo.or.cz/minetest_sfinv_buttons.git/tree/ebb1f7c
[ver.signs_lib]: https://gitlab.com/VanessaE/signs_lib/tree/2021-03-04-2 [ver.signs_lib]: https://gitlab.com/VanessaE/signs_lib/tree/2021-03-04-2
[ver.simple_protection]: https://github.com/SmallJoker/simple_protection/tree/3630fe9 [ver.simple_protection]: https://github.com/SmallJoker/simple_protection/tree/f1f85aa
[ver.slingshot]: https://github.com/AntumMT/mod-slingshot/releases/tag/v0.3 [ver.slingshot]: https://github.com/AntumMT/mod-slingshot/releases/tag/v0.3
[ver.sneeker]: https://github.com/AntumMT/mod-sneeker/releases/tag/v1.1 [ver.sneeker]: https://github.com/AntumMT/mod-sneeker/releases/tag/v1.1
[ver.snowdrift]: https://github.com/paramat/snowdrift/tree/3342939 [ver.snowdrift]: https://github.com/paramat/snowdrift/tree/3342939

View File

@ -1,4 +1,5 @@
local S = s_protect.translator local sp = simple_protection
local S = sp.translator
-- A shared chest for simple_protection but works with other protection mods too -- A shared chest for simple_protection but works with other protection mods too

View File

@ -1,8 +1,9 @@
local S = s_protect.translator local sp = simple_protection
local S = sp.translator
local commands = {} local commands = {}
function s_protect.register_subcommand(name, func) function sp.register_subcommand(name, func)
if commands[name] then if commands[name] then
minetest.log("info", "[simple_protection] Overwriting chat command " .. name) minetest.log("info", "[simple_protection] Overwriting chat command " .. name)
end end
@ -19,23 +20,23 @@ minetest.register_chatcommand("area", {
func = function(name, param) func = function(name, param)
if param == "" or param == "help" then if param == "" or param == "help" then
local function chat_send(desc, cmd) local function chat_send(desc, cmd)
minetest.chat_send_player(name, S(desc) .. ": " minetest.chat_send_player(name, desc .. ": "
.. minetest.colorize("#0FF", cmd)) .. minetest.colorize("#0FF", cmd))
end end
local privs = minetest.get_player_privs(name) local privs = minetest.get_player_privs(name)
minetest.chat_send_player(name, minetest.colorize("#0F0", minetest.chat_send_player(name, minetest.colorize("#0F0",
"=> " .. S("Available area commands"))) "=> " .. S("Available area commands")))
chat_send("Information about this area", "/area show") chat_send(S("Information about this area"), "/area show")
chat_send("View of surrounding areas", "/area radar") chat_send(S("View of surrounding areas"), "/area radar")
chat_send("(Un)share one area", "/area (un)share <name>") chat_send(S("(Un)share one area"), "/area (un)share <name>")
chat_send("(Un)share all areas", "/area (un)shareall <name>") chat_send(S("(Un)share all areas"), "/area (un)shareall <name>")
if s_protect.area_list or privs.simple_protection then if sp.area_list or privs.simple_protection then
chat_send("List claimed areas", "/area list [<name>]") chat_send(S("List claimed areas"), "/area list [<name>]")
end end
chat_send("Unclaim this area", "/area unclaim") chat_send(S("Unclaim this area"), "/area unclaim")
if privs.server then if privs.server then
chat_send("Delete all areas of a player", "/area delete <name>") chat_send(S("Delete all areas of a player"), "/area delete <name>")
end end
return return
end end
@ -50,18 +51,18 @@ minetest.register_chatcommand("area", {
end, end,
}) })
s_protect.register_subcommand("show", function(name, param) sp.register_subcommand("show", function(name, param)
local player = minetest.get_player_by_name(name) local player = minetest.get_player_by_name(name)
local player_pos = player:get_pos() local player_pos = player:get_pos()
local data = s_protect.get_claim(player_pos) local data = sp.get_claim(player_pos)
minetest.add_entity(s_protect.get_center(player_pos), "simple_protection:marker") minetest.add_entity(sp.get_center(player_pos), "simple_protection:marker")
local minp, maxp = s_protect.get_area_bounds(player_pos) local minp, maxp = sp.get_area_bounds(player_pos)
minetest.chat_send_player(name, S("Vertical from Y @1 to @2", minetest.chat_send_player(name, S("Vertical from Y @1 to @2",
tostring(minp.y), tostring(maxp.y))) tostring(minp.y), tostring(maxp.y)))
if not data then if not data then
if s_protect.underground_limit and minp.y < s_protect.underground_limit then if sp.underground_limit and minp.y < sp.underground_limit then
return true, S("Area status: @1", S("Not claimable")) return true, S("Area status: @1", S("Not claimable"))
end end
return true, S("Area status: @1", S("Unowned (!)")) return true, S("Area status: @1", S("Unowned (!)"))
@ -72,7 +73,7 @@ s_protect.register_subcommand("show", function(name, param)
for i, player in ipairs(data.shared) do for i, player in ipairs(data.shared) do
text = text..player..", " text = text..player..", "
end end
local shared = s_protect.share[data.owner] local shared = sp.share[data.owner]
if shared then if shared then
for i, player in ipairs(shared) do for i, player in ipairs(shared) do
text = text..player.."*, " text = text..player.."*, "
@ -86,7 +87,7 @@ end)
local function check_ownership(name) local function check_ownership(name)
local player = minetest.get_player_by_name(name) local player = minetest.get_player_by_name(name)
local data, index = s_protect.get_claim(player:get_pos()) local data, index = sp.get_claim(player:get_pos())
if not data then if not data then
return false, S("This area is not claimed yet.") return false, S("This area is not claimed yet.")
end end
@ -111,7 +112,7 @@ local function table_erase(t, e)
return removed return removed
end end
s_protect.register_subcommand("share", function(name, param) sp.register_subcommand("share", function(name, param)
if not param or name == param then if not param or name == param then
return false, S("No player name given.") return false, S("No player name given.")
end end
@ -123,15 +124,15 @@ s_protect.register_subcommand("share", function(name, param)
return success, data return success, data
end end
if s_protect.is_shared(name, param) then if sp.is_shared(name, param) then
return true, S("@1 already has access to all your areas.", param) return true, S("@1 already has access to all your areas.", param)
end end
if s_protect.is_shared(data, param) then if sp.is_shared(data, param) then
return true, S("@1 already has access to this area.", param) return true, S("@1 already has access to this area.", param)
end end
table.insert(data.shared, param) table.insert(data.shared, param)
s_protect.set_claim(data, index) sp.set_claim(data, index)
if minetest.get_player_by_name(param) then if minetest.get_player_by_name(param) then
minetest.chat_send_player(param, S("@1 shared an area with you.", name)) minetest.chat_send_player(param, S("@1 shared an area with you.", name))
@ -139,7 +140,7 @@ s_protect.register_subcommand("share", function(name, param)
return true, S("@1 has now access to this area.", param) return true, S("@1 has now access to this area.", param)
end) end)
s_protect.register_subcommand("unshare", function(name, param) sp.register_subcommand("unshare", function(name, param)
if not param or name == param or param == "" then if not param or name == param or param == "" then
return false, S("No player name given.") return false, S("No player name given.")
end end
@ -147,11 +148,11 @@ s_protect.register_subcommand("unshare", function(name, param)
if not success then if not success then
return success, data return success, data
end end
if not s_protect.is_shared(data, param) then if not sp.is_shared(data, param) then
return true, S("That player has no access to this area.") return true, S("That player has no access to this area.")
end end
table_erase(data.shared, param) table_erase(data.shared, param)
s_protect.set_claim(data, index) sp.set_claim(data, index)
if minetest.get_player_by_name(param) then if minetest.get_player_by_name(param) then
minetest.chat_send_player(param, S("@1 unshared an area with you.", name)) minetest.chat_send_player(param, S("@1 unshared an area with you.", name))
@ -159,7 +160,7 @@ s_protect.register_subcommand("unshare", function(name, param)
return true, S("@1 has no longer access to this area.", param) return true, S("@1 has no longer access to this area.", param)
end) end)
s_protect.register_subcommand("shareall", function(name, param) sp.register_subcommand("shareall", function(name, param)
if not param or name == param or param == "" then if not param or name == param or param == "" then
return false, S("No player name given.") return false, S("No player name given.")
end end
@ -170,14 +171,14 @@ s_protect.register_subcommand("shareall", function(name, param)
return false, S("Unknown player.") return false, S("Unknown player.")
end end
if s_protect.is_shared(name, param) then if sp.is_shared(name, param) then
return true, S("@1 already has now access to all your areas.", param) return true, S("@1 already has now access to all your areas.", param)
end end
if not shared then if not shared then
s_protect.share[name] = {} sp.share[name] = {}
end end
table.insert(s_protect.share[name], param) table.insert(sp.share[name], param)
s_protect.save_share_db() sp.save_share_db()
if minetest.get_player_by_name(param) then if minetest.get_player_by_name(param) then
minetest.chat_send_player(param, S("@1 shared all areas with you.", name)) minetest.chat_send_player(param, S("@1 shared all areas with you.", name))
@ -185,19 +186,19 @@ s_protect.register_subcommand("shareall", function(name, param)
return true, S("@1 has now access to all your areas.", param) return true, S("@1 has now access to all your areas.", param)
end) end)
s_protect.register_subcommand("unshareall", function(name, param) sp.register_subcommand("unshareall", function(name, param)
if not param or name == param or param == "" then if not param or name == param or param == "" then
return false, S("No player name given.") return false, S("No player name given.")
end end
local removed = false local removed = false
local shared = s_protect.share[name] local shared = sp.share[name]
if table_erase(shared, param) then if table_erase(shared, param) then
removed = true removed = true
s_protect.save_share_db() sp.save_share_db()
end end
-- Unshare each single claim -- Unshare each single claim
local claims = s_protect.get_player_claims(name) local claims = sp.get_player_claims(name)
for index, data in pairs(claims) do for index, data in pairs(claims) do
if table_erase(data.shared, param) then if table_erase(data.shared, param) then
removed = true removed = true
@ -206,30 +207,30 @@ s_protect.register_subcommand("unshareall", function(name, param)
if not removed then if not removed then
return false, S("@1 does not have access to any of your areas.", param) return false, S("@1 does not have access to any of your areas.", param)
end end
s_protect.update_claims(claims) sp.update_claims(claims)
if minetest.get_player_by_name(param) then if minetest.get_player_by_name(param) then
minetest.chat_send_player(param, S("@1 unshared all areas with you.", name)) minetest.chat_send_player(param, S("@1 unshared all areas with you.", name))
end end
return true, S("@1 has no longer access to your areas.", param) return true, S("@1 has no longer access to your areas.", param)
end) end)
s_protect.register_subcommand("unclaim", function(name) sp.register_subcommand("unclaim", function(name)
local success, data, index = check_ownership(name) local success, data, index = check_ownership(name)
if not success then if not success then
return success, data return success, data
end end
if s_protect.claim_return and name == data.owner then if sp.claim_return and name == data.owner then
local player = minetest.get_player_by_name(name) local player = minetest.get_player_by_name(name)
local inv = player:get_inventory() local inv = player:get_inventory()
if inv:room_for_item("main", "simple_protection:claim") then if inv:room_for_item("main", "simple_protection:claim") then
inv:add_item("main", "simple_protection:claim") inv:add_item("main", "simple_protection:claim")
end end
end end
s_protect.set_claim(nil, index) sp.set_claim(nil, index)
return true, S("This area is unowned now.") return true, S("This area is unowned now.")
end) end)
s_protect.register_subcommand("delete", function(name, param) sp.register_subcommand("delete", function(name, param)
if not param or name == param or param == "" then if not param or name == param or param == "" then
return false, S("No player name given.") return false, S("No player name given.")
end end
@ -238,18 +239,18 @@ s_protect.register_subcommand("delete", function(name, param)
end end
local removed = {} local removed = {}
if s_protect.share[param] then if sp.share[param] then
s_protect.share[param] = nil sp.share[param] = nil
table.insert(removed, S("Globally shared areas")) table.insert(removed, S("Globally shared areas"))
s_protect.save_share_db() sp.save_share_db()
end end
-- Delete all claims -- Delete all claims
local claims, count = s_protect.get_player_claims(param) local claims, count = sp.get_player_claims(param)
for index in pairs(claims) do for index in pairs(claims) do
claims[index] = false claims[index] = false
end end
s_protect.update_claims(claims) sp.update_claims(claims)
if count > 0 then if count > 0 then
table.insert(removed, S("@1 claimed area(s)", tostring(count))) table.insert(removed, S("@1 claimed area(s)", tostring(count)))
@ -261,9 +262,9 @@ s_protect.register_subcommand("delete", function(name, param)
return true, S("Removed")..": "..table.concat(removed, ", ") return true, S("Removed")..": "..table.concat(removed, ", ")
end) end)
s_protect.register_subcommand("list", function(name, param) sp.register_subcommand("list", function(name, param)
local has_sp_priv = minetest.check_player_privs(name, {simple_protection=true}) local has_sp_priv = minetest.check_player_privs(name, {simple_protection=true})
if not s_protect.area_list and not has_sp_priv then if not sp.area_list and not has_sp_priv then
return false, S("This command is not available.") return false, S("This command is not available.")
end end
if not param or param == "" then if not param or param == "" then
@ -274,16 +275,16 @@ s_protect.register_subcommand("list", function(name, param)
end end
local list = {} local list = {}
local width = s_protect.claim_size local width = sp.claim_size
local height = s_protect.claim_height local height = sp.claim_height
local claims = s_protect.get_player_claims(param) local claims = sp.get_player_claims(param)
for index in pairs(claims) do for index in pairs(claims) do
-- TODO: Add database-specific function to convert the index to a position -- TODO: Add database-specific function to convert the index to a position
local abs_pos = minetest.string_to_pos(index) local abs_pos = minetest.string_to_pos(index)
table.insert(list, string.format("%5i,%5i,%5i", table.insert(list, string.format("%5i,%5i,%5i",
abs_pos.x * width + (width / 2), abs_pos.x * width + (width / 2),
abs_pos.y * height - s_protect.start_underground + (height / 2), abs_pos.y * height - sp.start_underground + (height / 2),
abs_pos.z * width + (width / 2) abs_pos.z * width + (width / 2)
)) ))
end end

View File

@ -10,6 +10,8 @@ lSQLite database functions:
update_claims(claims table) update_claims(claims table)
]] ]]
error("lSqlite backend is incomplete")
local worldpath = minetest.get_worldpath() local worldpath = minetest.get_worldpath()
local ie = minetest.request_insecure_environment() local ie = minetest.request_insecure_environment()

View File

@ -11,14 +11,13 @@ Raw text format database functions:
]] ]]
local claim_data = {} local claim_data = {}
local claim_db = { time = os.time(), dirty = false } local sp = simple_protection
local share_db = { time = os.time(), dirty = false }
function s_protect.load_db() function sp.load_db()
-- Don't forget the "parties" -- Don't forget the "parties"
s_protect.load_shareall() sp.load_shareall()
local file = io.open(s_protect.file, "r") local file = io.open(sp.file, "r")
if not file then if not file then
return return
end end
@ -39,8 +38,8 @@ function s_protect.load_db()
minetest.log("action", "[simple_protection] Loaded claim data") minetest.log("action", "[simple_protection] Loaded claim data")
end end
function s_protect.load_shareall() function sp.load_shareall()
local file = io.open(s_protect.sharefile, "r") local file = io.open(sp.sharefile, "r")
if not file then if not file then
return return
end end
@ -55,7 +54,7 @@ function s_protect.load_shareall()
table.insert(_shared, data[index]) table.insert(_shared, data[index])
end end
end end
s_protect.share[data[1]] = _shared sp.share[data[1]] = _shared
end end
end end
end end
@ -63,6 +62,9 @@ function s_protect.load_shareall()
minetest.log("action", "[simple_protection] Loaded shared claims") minetest.log("action", "[simple_protection] Loaded shared claims")
end end
local claim_db = { time = os.time(), dirty = false }
local share_db = { time = os.time(), dirty = false }
local function delay(db_info, func) local function delay(db_info, func)
local dtime = os.time() - db_info.time local dtime = os.time() - db_info.time
if dtime < 6 then if dtime < 6 then
@ -90,28 +92,28 @@ local function save_claims()
table.concat(data.shared, " ") table.concat(data.shared, " ")
end end
end end
minetest.safe_file_write(s_protect.file, table.concat(contents, "\n")) minetest.safe_file_write(sp.file, table.concat(contents, "\n"))
end end
function s_protect.save_share_db() function sp.save_share_db()
if delay(share_db, s_protect.save_share_db) then if delay(share_db, sp.save_share_db) then
return return
end end
-- Save globally shared areas -- Save globally shared areas
local contents = {} local contents = {}
for name, players in pairs(s_protect.share) do for name, players in pairs(sp.share) do
if #players > 0 then if #players > 0 then
contents[#contents + 1] = name .. " " .. contents[#contents + 1] = name .. " " ..
table.concat(players, " ") table.concat(players, " ")
end end
end end
minetest.safe_file_write(s_protect.sharefile, table.concat(contents, "\n")) minetest.safe_file_write(sp.sharefile, table.concat(contents, "\n"))
end end
-- Speed up the function access -- Speed up the function access
local get_location = s_protect.get_location local get_location = sp.get_location
function s_protect.get_claim(pos, direct_access) function sp.get_claim(pos, direct_access)
if direct_access then if direct_access then
return claim_data[pos], pos return claim_data[pos], pos
end end
@ -120,12 +122,12 @@ function s_protect.get_claim(pos, direct_access)
return claim_data[index], index return claim_data[index], index
end end
function s_protect.set_claim(data, index) function sp.set_claim(data, index)
claim_data[index] = data claim_data[index] = data
save_claims() save_claims()
end end
function s_protect.get_player_claims(owner) function sp.get_player_claims(owner)
local count = 0 local count = 0
local claims = {} local claims = {}
for index, data in pairs(claim_data) do for index, data in pairs(claim_data) do
@ -137,7 +139,7 @@ function s_protect.get_player_claims(owner)
return claims, count return claims, count
end end
function s_protect.update_claims(updated) function sp.update_claims(updated)
for index, data in pairs(updated) do for index, data in pairs(updated) do
if not data then if not data then
claim_data[index] = nil claim_data[index] = nil
@ -156,12 +158,12 @@ local function table_contains(t, to_find)
end end
return false return false
end end
function s_protect.is_shared(id, player_name) function sp.is_shared(id, player_name)
if type(id) == "table" and id.shared then if type(id) == "table" and id.shared then
-- by area -- by area
return table_contains(id.shared, player_name) return table_contains(id.shared, player_name)
end end
assert(type(id) == "string", "is_shared(): Either ClaimData or string expected") assert(type(id) == "string", "is_shared(): Either ClaimData or string expected")
-- by owner -- by owner
return table_contains(s_protect.share[id] or {}, player_name) return table_contains(sp.share[id] or {}, player_name)
end end

View File

@ -12,42 +12,43 @@ simple_protection/default_settings.lua
unwanted side effects when claims were made. unwanted side effects when claims were made.
]] ]]
local sp = simple_protection
-- Width and length of claims in nodes -- Width and length of claims in nodes
-- !! Distorts the claim locations along the X and Z axis !! -- !! Distorts the claim locations along the X and Z axis !!
-- Type: Integer, positive, even number -- Type: Integer, positive, even number
s_protect.claim_size = 16 sp.claim_size = 16
-- Height of claims in nodes -- Height of claims in nodes
-- !! Distorts the claim locations along the Y axis !! -- !! Distorts the claim locations along the Y axis !!
-- Type: Integer, positive -- Type: Integer, positive
s_protect.claim_height = 150 sp.claim_height = 150
-- Defines the Y offset where the 0th claim should start in the underground -- Defines the Y offset where the 0th claim should start in the underground
-- Example of claim (0,0,0): Ymin = -(50) = -50, Ymax = 150 - (50) - 1 = 99 -- Example of claim (0,0,0): Ymin = -(50) = -50, Ymax = 150 - (50) - 1 = 99
-- Type: Integer -- Type: Integer
s_protect.start_underground = 50 sp.start_underground = 50
-- Only allows claiming above this Y value -- Only allows claiming above this Y value
-- To disable this limit, set the value to 'nil' -- To disable this limit, set the value to 'nil'
-- Type: Integer or nil -- Type: Integer or nil
s_protect.underground_limit = -300 sp.underground_limit = -300
-- Returns the claim stick when unclaiming the area -- Returns the claim stick when unclaiming the area
-- Type: Boolean -- Type: Boolean
s_protect.claim_return = true sp.claim_return = true
-- Players will need to claim the area (or have access to it) to dig -- Players will need to claim the area (or have access to it) to dig
-- Digging will be still allowed in the underground, -- Digging will be still allowed in the underground,
-- as defined by the setting 's_protect.underground_limit' -- as defined by the setting 'simple_protection.underground_limit'
-- Type: Boolean -- Type: Boolean
s_protect.claim_to_dig = false sp.claim_to_dig = false
-- Allows players to list their areas using '/area list' -- Allows players to list their areas using '/area list'
-- Type: Boolean -- Type: Boolean
s_protect.area_list = true sp.area_list = true
-- Limits the amount of claims per player -- Limits the amount of claims per player
-- Doubled limit for players with the 'simple_protection' privilege -- Doubled limit for players with the 'simple_protection' privilege
-- Type: Integer -- Type: Integer
s_protect.max_claims = 200 sp.max_claims = 200

View File

@ -6,16 +6,19 @@ HUD display and refreshing
]] ]]
local S = s_protect.translator local sp = simple_protection
local S = sp.translator
s_protect.player_huds = {} sp.player_huds = {}
local hud_time = 0 local hud_timer = 0
-- Text to put in front of the HUD element
local prefix = "" local prefix = ""
-- HUD default position
local align_x = 1 local align_x = 1
local pos_x = 0.02 local pos_x = 0.02
-- If areas is installed: Move the HUD to th opposite side -- If areas is installed: Move the HUD to the opposite side
if minetest.get_modpath("areas") then if minetest.get_modpath("areas") then
prefix = "Simple Protection:\n" prefix = "Simple Protection:\n"
align_x = -1 align_x = -1
@ -28,7 +31,7 @@ local function generate_hud(player, current_owner, has_access)
if has_access then if has_access then
color = 0x00CC00 color = 0x00CC00
end end
s_protect.player_huds[player:get_player_name()] = { sp.player_huds[player:get_player_name()] = {
hud_id = player:hud_add({ hud_id = player:hud_add({
hud_elem_type = "text", hud_elem_type = "text",
name = "area_hud", name = "area_hud",
@ -45,18 +48,18 @@ local function generate_hud(player, current_owner, has_access)
end end
minetest.register_globalstep(function(dtime) minetest.register_globalstep(function(dtime)
hud_time = hud_time + dtime hud_timer = hud_timer + dtime
if hud_time < 2.9 then if hud_timer < 2.9 then
return return
end end
hud_time = 0 hud_timer = 0
local is_shared = s_protect.is_shared local is_shared = sp.is_shared
for _, player in ipairs(minetest.get_connected_players()) do for _, player in ipairs(minetest.get_connected_players()) do
local player_name = player:get_player_name() local player_name = player:get_player_name()
local current_owner = "" local current_owner = ""
local data = s_protect.get_claim(player:get_pos()) local data = sp.get_claim(player:get_pos())
if data then if data then
current_owner = data.owner current_owner = data.owner
end end
@ -72,7 +75,7 @@ minetest.register_globalstep(function(dtime)
end end
local changed = true local changed = true
local hud_table = s_protect.player_huds[player_name] local hud_table = sp.player_huds[player_name]
if hud_table and hud_table.owner == current_owner if hud_table and hud_table.owner == current_owner
and hud_table.had_access == has_access then and hud_table.had_access == has_access then
-- still the same hud -- still the same hud
@ -81,7 +84,7 @@ minetest.register_globalstep(function(dtime)
if changed and hud_table then if changed and hud_table then
player:hud_remove(hud_table.hud_id) player:hud_remove(hud_table.hud_id)
s_protect.player_huds[player_name] = nil sp.player_huds[player_name] = nil
end end
if changed and current_owner ~= "" then if changed and current_owner ~= "" then

View File

@ -5,31 +5,37 @@ if not minetest.get_translator then
.. " (version < 5.0.0)") .. " (version < 5.0.0)")
end end
simple_protection = {}
local world_path = minetest.get_worldpath() local world_path = minetest.get_worldpath()
s_protect = {} local sp = simple_protection
s_protect.translator = minetest.get_translator("simple_protection") -- Backwards compat
s_protect.share = {} s_protect = sp
s_protect.mod_path = minetest.get_modpath("simple_protection")
s_protect.conf = world_path.."/s_protect.conf" sp.translator = minetest.get_translator("simple_protection")
s_protect.file = world_path.."/s_protect.data" sp.share = {}
s_protect.sharefile = world_path.."/s_protect_share.data" sp.mod_path = minetest.get_modpath("simple_protection")
sp.conf = world_path.."/s_protect.conf"
sp.file = world_path.."/s_protect.data"
sp.sharefile = world_path.."/s_protect_share.data"
local S = sp.translator
minetest.register_privilege("simple_protection", minetest.register_privilege("simple_protection",
s_protect.translator("Allows to modify and delete protected areas")) S("Allows to modify and delete protected areas"))
-- Load helper functions and configuration -- Load helper functions and configuration
dofile(s_protect.mod_path.."/misc_functions.lua") dofile(sp.mod_path.."/misc_functions.lua")
s_protect.load_config() sp.load_config()
-- Load database functions -- Load database functions
dofile(s_protect.mod_path.."/command_mgr.lua") dofile(sp.mod_path.."/command_mgr.lua")
dofile(s_protect.mod_path.."/database_raw.lua") dofile(sp.mod_path.."/database_raw.lua")
-- Spread the load a bit -- Spread the load a bit
minetest.after(0.5, s_protect.load_db) minetest.after(0.5, sp.load_db)
-- General things to make this mod friendlier -- General things to make this mod friendlier
dofile(s_protect.mod_path.."/protection.lua") dofile(sp.mod_path.."/protection.lua")
dofile(s_protect.mod_path.."/hud.lua") dofile(sp.mod_path.."/hud.lua")
dofile(s_protect.mod_path.."/radar.lua") dofile(sp.mod_path.."/radar.lua")
dofile(s_protect.mod_path.."/chest.lua") dofile(sp.mod_path.."/chest.lua")

View File

@ -1,15 +1,8 @@
# textdomain: simple_protection # textdomain: simple_protection
# Translated by: Krock/SmallJoker Shared Chest=Geteilte Truhe
(by protection)=(durch Gebietsschutz)
# Privilege description
Allows to modify and delete protected areas=Erlaubt das Abändern und Entfernen von geschützten Gebieten
#### AREA COMMAND ####
# Command description # Command description
Manages all of your areas.=Verwaltet alle deine geschützten Gebiete Manages all of your areas.=Verwaltet alle deine geschützten Gebiete
# /area # /area
Available area commands=Verfügbare 'area' Befehle Available area commands=Verfügbare 'area' Befehle
Information about this area=Informationen über dieses Gebiet Information about this area=Informationen über dieses Gebiet
@ -17,16 +10,10 @@ View of surrounding areas=Übersicht von allen Gebieten
(Un)share one area=Zugriffs-Berechtigung eines Gebietes hinzufügen/entfernen (Un)share one area=Zugriffs-Berechtigung eines Gebietes hinzufügen/entfernen
(Un)share all areas=Zugriffs-Berechtigung für alle Gebiete hinzufügen/entfernen (Un)share all areas=Zugriffs-Berechtigung für alle Gebiete hinzufügen/entfernen
List claimed areas=Geschützte Gebiete auflisten List claimed areas=Geschützte Gebiete auflisten
Delete all areas of a player=Alle Gebiete eines Spielers löschen
Unclaim this area=Den Schutz für dieses Gebiet aufheben Unclaim this area=Den Schutz für dieses Gebiet aufheben
Delete all areas of a player=Alle Gebiete eines Spielers löschen
# Errors of /area # Errors of /area
Unknown command parameter: @1. Check '/area' for correct usage.=Unbekannter Befehls-Parameter: @1. Siehe '/area' für die korrekte Anwendung. Unknown command parameter: @1. Check '/area' for correct usage.=Unbekannter Befehls-Parameter: @1. Siehe '/area' für die korrekte Anwendung.
No player name given.=Kein Spielernahme gegeben.
Unknown player.=Unbekannter Spieler.
This area is not claimed yet.=Dieses Gebiet ist noch nicht geschützt.
You do not own this area.=Du besitzt dieses Gebiet nicht.
# /area show # /area show
Vertical from Y @1 to @2=Senkrecht von Y @1 bis @2 Vertical from Y @1 to @2=Senkrecht von Y @1 bis @2
Area status: @1=Gebiets-Status: @1 Area status: @1=Gebiets-Status: @1
@ -34,75 +21,69 @@ Not claimable=Nicht schützbar
Unowned (!)=Nicht geschützt (!) Unowned (!)=Nicht geschützt (!)
Owned by @1=Von @1 geschützt Owned by @1=Von @1 geschützt
Players with access: @1=Spieler mit Zugriff: @1 Players with access: @1=Spieler mit Zugriff: @1
This area is not claimed yet.=Dieses Gebiet ist noch nicht geschützt.
# /area radar You do not own this area.=Du besitzt dieses Gebiet nicht.
North @1=Nord @1 No player name given.=Kein Spielernahme gegeben.
East @1=Ost @1 Unknown player.=Unbekannter Spieler.
South @1=Süd @1
West @1=West @1
Your position=Deine Position
Your area=Dein Gebiet
Area claimed\nNo access for you=Gebiet geschützt\nKeine Berechtigung
Access for everybody=Zugriff für jeden
One area unit (@1m) up/down\n-> no claims on this Y level=Ein Gebiet (@1m) ober-/unterhalb
square \= 1 area \= @1x@2x@3 nodes (X,Y,Z)=1 Quadrat \= 1 Gebiet \= @1x@2x@3 Blöcke (X,Y,Z)
# /area share <name> # /area share <name>
@1 already has access to all your areas.=@1 hat bereits Zugriff auf alle deine Gebiete. @1 already has access to all your areas.=@1 hat bereits Zugriff auf alle deine Gebiete.
@1 already has access to this area.=@1 hat bereits Zugriff auf dieses Gebiet. @1 already has access to this area.=@1 hat bereits Zugriff auf dieses Gebiet.
@1 shared an area with you.=Du hast jetzt Zugriff auf ein Gebiet von @1. @1 shared an area with you.=Du hast jetzt Zugriff auf ein Gebiet von @1.
@1 has now access to this area.=@1 kann jetzt dieses Gebiet abändern. @1 has now access to this area.=@1 kann jetzt dieses Gebiet abändern.
# /area unshare <name> # /area unshare <name>
That player has no access to this area.=Dieser Spieler hat keinen Zugriff auf dieses Gebiet. That player has no access to this area.=Dieser Spieler hat keinen Zugriff auf dieses Gebiet.
@1 unshared an area with you.=Du hast nun keinen Zugriff auf ein Gebiet von @1 mehr. @1 unshared an area with you.=Du hast nun keinen Zugriff auf ein Gebiet von @1 mehr.
@1 has no longer access to this area.=@1 kann jetzt dieses Gebiet nicht mehr abändern. @1 has no longer access to this area.=@1 kann jetzt dieses Gebiet nicht mehr abändern.
# /area shareall <name> # /area shareall <name>
You can not share all your areas with everybody.=Du kannst nicht alle Gebiete mit jedem teilen. You can not share all your areas with everybody.=Du kannst nicht alle Gebiete mit jedem teilen.
@1 already has now access to all your areas.=@1 hat bereits Zugriff auf alle deine Gebiete @1 already has now access to all your areas.=@1 hat bereits Zugriff auf alle deine Gebiete
@1 shared all areas with you.=@1 hat dir Zufriff auf alle die Gebiete erlaubt. @1 shared all areas with you.=@1 hat dir Zufriff auf alle die Gebiete erlaubt.
@1 has now access to all your areas.=@1 kann jetzt alle deine Gebiete abändern. @1 has now access to all your areas.=@1 kann jetzt alle deine Gebiete abändern.
# /area unshareall <name> # /area unshareall <name>
@1 does not have access to any of your areas.=@1 hat keinen Zugriff auf deine Gebiete. @1 does not have access to any of your areas.=@1 hat keinen Zugriff auf deine Gebiete.
@1 unshared all areas with you.=@1 hat dir den Zugriff auf die Gebiete verwehrt. @1 unshared all areas with you.=@1 hat dir den Zugriff auf die Gebiete verwehrt.
@1 has no longer access to your areas.=@1 kann keines deiner Gebiete mehr abändern. @1 has no longer access to your areas.=@1 kann keines deiner Gebiete mehr abändern.
# /area unclaim # /area unclaim
This area is unowned now.=Dieses Gebiet ist nun nicht mehr geschützt. This area is unowned now.=Dieses Gebiet ist nun nicht mehr geschützt.
# /area delete <name> # /area delete <name>
Missing privilege: @1=Fehlendes Privileg: @1 Missing privilege: @1=Fehlendes Privileg: @1
Removed=Entfernt
Globally shared areas=Globale Gebietszugiffe Globally shared areas=Globale Gebietszugiffe
@1 claimed area(s)=@1 geschützte(s) Gebiet(e) @1 claimed area(s)=@1 geschützte(s) Gebiet(e)
@1 does not own any claimed areas.=@1 besitzt keine geschützten Gebiete. @1 does not own any claimed areas.=@1 besitzt keine geschützten Gebiete.
Removed=Entfernt
# /area list [name] # /area list [name]
This command is not available.=Dieser Befehl ist nicht verfügbar. This command is not available.=Dieser Befehl ist nicht verfügbar.
Listing all areas of @1. Amount: @2=Auslistung der Gebiete von @1. Anzahl: @2 Listing all areas of @1. Amount: @2=Auslistung der Gebiete von @1. Anzahl: @2
Share this area=
Remove an area share=
#### Protection #### Share all areas=
Remove all area shares=
# Item place information Also removes individual area shares=
Area owned by: @1=Gebiet geschützt durch: @1 Requires the '@1' privilege=
List all areas=
# Hud text # Hud text
Area owner: @1=Gebiets-Besitzer: @1 Area owner: @1=Gebiets-Besitzer: @1
Allows to modify and delete protected areas=Erlaubt das Abändern und Entfernen von geschützten Gebieten
Please claim this area to modify it.=Bitte schütze das Gebiet um dieses abändern zu können.
# Item place information
Area owned by: @1=Gebiet geschützt durch: @1
# Item: Claim stick # Item: Claim stick
Claim Stick=Gebietsschutz Claim Stick=Gebietsschutz
(click to protect)=
#(click to protect)=(kicken zum schützen) #(click to protect)=(kicken zum schützen)
This area is already protected by an other protection mod.=Dieses Gebiet ist bereits durch eine andere Mod geschützt. This area is already protected by an other protection mod.=Dieses Gebiet ist bereits durch eine andere Mod geschützt.
You can not claim areas below @1.=Du kannst keine Gebiete unterhalb von @1 schützen. You can not claim areas below @1.=Du kannst keine Gebiete unterhalb von @1 schützen.
This area is already owned by: @1=@1 besitzt dieses Gebiet bereits. This area is already owned by: @1=@1 besitzt dieses Gebiet bereits.
Congratulations! You now own this area.=Glückwunsch! Du besitzt dieses Gebiet jetzt.
You can not claim any further areas: Limit (@1) reached.=Du kannst keine weiteren Gebiete schützen lassen: Limit (@1) erreicht. You can not claim any further areas: Limit (@1) reached.=Du kannst keine weiteren Gebiete schützen lassen: Limit (@1) erreicht.
Please claim this area to modify it.=Bitte schütze das Gebiet um dieses abändern zu können. Congratulations! You now own this area.=Glückwunsch! Du besitzt dieses Gebiet jetzt.
# /area radar
North @1=Nord @1
#### Shared Chest #### West @1=West @1
South @1=Süd @1
Shared Chest=Geteilte Truhe East @1=Ost @1
(by protection)=(durch Gebietsschutz) square @= 1 area @= @1x@2x@3 nodes (X,Y,Z)=1 Quadrat @= 1 Gebiet @= @1x@2x@3 Blöcke (X,Y,Z)
Your position=Deine Position
Your area=Dein Gebiet
Area claimed@nNo access for you=Gebiet geschützt@nKeine Berechtigung
Access for everybody=Zugriff für jeden
One area unit (@1m) up/down@n-> no claims on this Y level=Ein Gebiet (@1m) ober-/unterhalb@n-> kein Gebiet auf dieser Höhe

View File

@ -1,31 +1,19 @@
# textdomain: simple_protection # textdomain: simple_protection
# Translated by: d-stephane Shared Chest=Coffre partagé
(by protection)=(par protection)
# Privilege description
Allows to modify and delete protected areas=Permet de modifier et supprimer des zones protégées
#### AREA COMMAND ####
# Command description # Command description
Manages all of your areas.=Gestion de toutes vos zones. Manages all of your areas.=Gestion de toutes vos zones.
# /area # /area
Available area commands=Commandes de zone disponibles Available area commands=Commandes de zone disponibles
Information about this area=Informations sur cette zone Information about this area=Informations sur cette zone
View of surrounding areas=
(Un)share one area=Partager (ou pas) une zone (Un)share one area=Partager (ou pas) une zone
(Un)share all areas=Partager (ou pas) toutes les zones (Un)share all areas=Partager (ou pas) toutes les zones
List claimed areas=Liste des zones revendiquées List claimed areas=Liste des zones revendiquées
Delete all areas of a player=Supprimer toutes les zones d'un joueur
Unclaim this area=Libérer cette zone Unclaim this area=Libérer cette zone
Delete all areas of a player=Supprimer toutes les zones d'un joueur
# Errors of /area # Errors of /area
Unknown command parameter: @1. Check '/area' for correct usage.=Paramètre de commande inconnu : @1. Tappez '/area' pour voir les paramètres possible. Unknown command parameter: @1. Check '/area' for correct usage.=Paramètre de commande inconnu : @1. Tappez '/area' pour voir les paramètres possible.
No player name given.=Aucun nom de joueur donné.
Unknown player.=Joueur inconnu.
This area is not claimed yet.=Cette zone n'est pas encore revendiquée.
You do not own this area.=Vous ne possédez pas cette zone.
# /area show # /area show
Vertical from Y @1 to @2=Verticale de Y @1 à @2 Vertical from Y @1 to @2=Verticale de Y @1 à @2
Area status: @1=Statut de la zone : @1 Area status: @1=Statut de la zone : @1
@ -33,75 +21,75 @@ Not claimable=Non revendiquable
Unowned (!)=Pas de propriétaire (!) Unowned (!)=Pas de propriétaire (!)
Owned by @1=Possédée par @1 Owned by @1=Possédée par @1
Players with access: @1=Joueurs avec accès : @1 Players with access: @1=Joueurs avec accès : @1
This area is not claimed yet.=Cette zone n'est pas encore revendiquée.
# /area radar You do not own this area.=Vous ne possédez pas cette zone.
North @1=Nord @1 No player name given.=Aucun nom de joueur donné.
East @1=Est @1 Unknown player.=Joueur inconnu.
South @1=Sud @1
West @1=Ouest @1
Your position=Votre position
Your area=Votre zone
Area claimed\nNo access for you=Zone revendiquée\nNon accessible pour vous
Access for everybody=Accès pour tout le monde
One area unit (@1m) up/down\n-> no claims on this Y level=Une unité de zone (@1m) haut/bas\n-> Rien de revendiqué à ce niveau Y
square \= 1 area \= @1x@2x@3 nodes (X,Y,Z)=carré \= 1 zone \= @1x@2x@3 blocs (X,Y,Z)
# /area share <name> # /area share <name>
@1 already has access to all your areas.=@1 a déjà accès à toutes vos zones. @1 already has access to all your areas.=@1 a déjà accès à toutes vos zones.
@1 already has access to this area.=@1 a déjà accès à cette zone. @1 already has access to this area.=@1 a déjà accès à cette zone.
@1 shared an area with you.=@1 a partagé une zone avec vous. @1 shared an area with you.=@1 a partagé une zone avec vous.
@1 has now access to this area.=@1 a maintenant accès à cette zone. @1 has now access to this area.=@1 a maintenant accès à cette zone.
# /area unshare <name> # /area unshare <name>
That player has no access to this area.=Ce joueur n'a pas accès à cette zone. That player has no access to this area.=Ce joueur n'a pas accès à cette zone.
@1 unshared an area with you.=@1 a enlevé le partage de la zone avec vous. @1 unshared an area with you.=@1 a enlevé le partage de la zone avec vous.
@1 has no longer access to this area.=@1 n'a plus accès à cette zone. @1 has no longer access to this area.=@1 n'a plus accès à cette zone.
# /area shareall <name> # /area shareall <name>
You can not share all your areas with everybody.=Vous ne pouvez pas partager toutes vos zones avec tout le monde. You can not share all your areas with everybody.=Vous ne pouvez pas partager toutes vos zones avec tout le monde.
@1 already has now access to all your areas.=@1 a déjà accès à toutes vos zones. @1 already has now access to all your areas.=@1 a déjà accès à toutes vos zones.
@1 shared all areas with you.=@1 a partagé toutes les zones avec vous. @1 shared all areas with you.=@1 a partagé toutes les zones avec vous.
@1 has now access to all your areas.=@1 a maintenant accès à toutes vos zones. @1 has now access to all your areas.=@1 a maintenant accès à toutes vos zones.
# /area unshareall <name> # /area unshareall <name>
@1 does not have access to any of your areas.=@1 n'a accès à aucune de vos zones. @1 does not have access to any of your areas.=@1 n'a accès à aucune de vos zones.
@1 unshared all areas with you.=@1 a enlevé le partage de toutes les zones avec vous. @1 unshared all areas with you.=@1 a enlevé le partage de toutes les zones avec vous.
@1 has no longer access to your areas.=@1 n'a plus accès à vos zones. @1 has no longer access to your areas.=@1 n'a plus accès à vos zones.
# /area unclaim # /area unclaim
This area is unowned now.=Cette zone n'est plus revendiquée. This area is unowned now.=Cette zone n'est plus revendiquée.
# /area delete <name> # /area delete <name>
Missing privilege: @1=Privilège manquant : @1 Missing privilege: @1=Privilège manquant : @1
Removed=Supprimé
Globally shared areas=Zones partagées globalement Globally shared areas=Zones partagées globalement
@1 claimed area(s)=@1 a revendiqué des zones @1 claimed area(s)=@1 a revendiqué des zones
@1 does not own any claimed areas.=@1 ne possède aucune zone revendiquée. @1 does not own any claimed areas.=@1 ne possède aucune zone revendiquée.
Removed=Supprimé
# /area list [name] # /area list [name]
This command is not available.=Cette commande n'est pas disponible. This command is not available.=Cette commande n'est pas disponible.
Listing all areas of @1. Amount: @2=Liste de tous les zones de @1. Total : @2 Listing all areas of @1. Amount: @2=Liste de tous les zones de @1. Total : @2
Share this area=
Remove an area share=
#### Protection #### Share all areas=
Remove all area shares=
# Item place information Also removes individual area shares=
Area owned by: @1=Zone appartenant à : @1 Requires the '@1' privilege=
List all areas=
# Hud text # Hud text
Area owner: @1=Propriétaire de la zone : @1 Area owner: @1=Propriétaire de la zone : @1
Allows to modify and delete protected areas=Permet de modifier et supprimer des zones protégées
Please claim this area to modify it.=Veuillez revendiquer cette zone pour la modifier.
# Item place information
Area owned by: @1=Zone appartenant à : @1
# Item: Claim stick # Item: Claim stick
Claim Stick=Bâton de protection Claim Stick=Bâton de protection
(click to protect)=(cliquez pour protéger) (click to protect)=(cliquez pour protéger)
This area is already protected by an other protection mod.=Cette zone est déjà protégée par un autre mod de protection. This area is already protected by an other protection mod.=Cette zone est déjà protégée par un autre mod de protection.
You can not claim areas below @1.=Vous ne pouvez pas revendiquer les zones ci-dessous @1. You can not claim areas below @1.=Vous ne pouvez pas revendiquer les zones ci-dessous @1.
This area is already owned by: @1=Cette zone est déjà détenue par : @1. This area is already owned by: @1=Cette zone est déjà détenue par : @1.
Congratulations! You now own this area.=Félicitations ! Vous possédez maintenant cette zone.
You can not claim any further areas: Limit (@1) reached.=Vous ne pouvez pas revendiquer d'autres zones : La limite de @1 a été atteinte. You can not claim any further areas: Limit (@1) reached.=Vous ne pouvez pas revendiquer d'autres zones : La limite de @1 a été atteinte.
Please claim this area to modify it.=Veuillez revendiquer cette zone pour la modifier. Congratulations! You now own this area.=Félicitations ! Vous possédez maintenant cette zone.
# /area radar
North @1=Nord @1
West @1=Ouest @1
South @1=Sud @1
East @1=Est @1
square @= 1 area @= @1x@2x@3 nodes (X,Y,Z)=
Your position=Votre position
Your area=Votre zone
Area claimed@nNo access for you=
Access for everybody=Accès pour tout le monde
One area unit (@1m) up/down@n-> no claims on this Y level=
#### Shared Chest #### ##### not used anymore #####
Shared Chest=Coffre partagé Area claimed\nNo access for you=Zone revendiquée\nNon accessible pour vous
(by protection)=(par protection) One area unit (@1m) up/down\n-> no claims on this Y level=Une unité de zone (@1m) haut/bas\n-> Rien de revendiqué à ce niveau Y
square \= 1 area \= @1x@2x@3 nodes (X,Y,Z)=carré \= 1 zone \= @1x@2x@3 blocs (X,Y,Z)

View File

@ -1,31 +1,21 @@
# textdomain: simple_protection # textdomain: simple_protection
# Translated by: BrunoMine Shared Chest=
(by protection)=
# Privilege description
Allows to modify and delete protected areas=Permitir modificar e deletar areas protegidas
#### AREA COMMAND ####
# Command description # Command description
Manages all of your areas.=Gerencia todas as suas areas. Manages all of your areas.=Gerencia todas as suas areas.
# /area # /area
Available area commands=Comandos disponiveis Available area commands=Comandos disponiveis
Information about this area=Dados sobre essa area Information about this area=Dados sobre essa area
View of surrounding areas=
(Un)share one area=(Des)compartilha uma area (Un)share one area=(Des)compartilha uma area
(Un)share all areas=(Des)compartilha todas areas (Un)share all areas=(Des)compartilha todas areas
List claimed areas=
#List claimed areas = #List claimed areas =
#Delete all areas of a player = #Delete all areas of a player =
Unclaim this area=Desfazer-se dessa area Unclaim this area=Desfazer-se dessa area
Delete all areas of a player=
# Errors of /area # Errors of /area
Unknown command parameter: @1. Check '/area' for correct usage.=Parametro de comando desconhecido: @1. Use '/area' para o uso correto. Unknown command parameter: @1. Check '/area' for correct usage.=Parametro de comando desconhecido: @1. Use '/area' para o uso correto.
No player name given.=Nenhum nome de jogador dado.
Unknown player.=Jogador desconhecido.
This area is not claimed yet.=Essa area nao foi reivindicada ainda.
You do not own this area.=Voce nao pode possuir essa area.
# /area show # /area show
Vertical from Y @1 to @2=Vertical em Y @1 a @2 Vertical from Y @1 to @2=Vertical em Y @1 a @2
Area status: @1=Status da area: @1 Area status: @1=Status da area: @1
@ -33,7 +23,10 @@ Not claimable=Nao reivindicada
Unowned (!)=Sem dono (!) Unowned (!)=Sem dono (!)
Owned by @1=Reivindicada por @1 Owned by @1=Reivindicada por @1
Players with access: @1=Jogadores com acesso: @1 Players with access: @1=Jogadores com acesso: @1
This area is not claimed yet.=Essa area nao foi reivindicada ainda.
You do not own this area.=Voce nao pode possuir essa area.
No player name given.=Nenhum nome de jogador dado.
Unknown player.=Jogador desconhecido.
# /area radar # /area radar
#North @1 = #North @1 =
#East @1 = #East @1 =
@ -43,63 +36,63 @@ Players with access: @1=Jogadores com acesso: @1
#Your area = #Your area =
#Area claimed\nNo access for you = #Area claimed\nNo access for you =
#Access for everybody = #Access for everybody =
# /area share <name> # /area share <name>
@1 already has access to all your areas.=@1 ja possui acesso a todas suas areas. @1 already has access to all your areas.=@1 ja possui acesso a todas suas areas.
@1 already has access to this area.=@1 ja possui acesso a essa area. @1 already has access to this area.=@1 ja possui acesso a essa area.
@1 shared an area with you.=@1 compartilhou uma area contigo. @1 shared an area with you.=@1 compartilhou uma area contigo.
@1 has now access to this area.=@1 agora tem acesso nessa area. @1 has now access to this area.=@1 agora tem acesso nessa area.
# /area unshare <name> # /area unshare <name>
That player has no access to this area.=Esse jogador nao tem acesso a essa area. That player has no access to this area.=Esse jogador nao tem acesso a essa area.
@1 unshared an area with you.=@1 descompartilhou uma area contigo. @1 unshared an area with you.=@1 descompartilhou uma area contigo.
@1 has no longer access to this area.=@1 deixou de ter acesso a essa area. @1 has no longer access to this area.=@1 deixou de ter acesso a essa area.
# /area shareall <name> # /area shareall <name>
You can not share all your areas with everybody.=Nao podes compartilhar todas as suas areas com todos. You can not share all your areas with everybody.=Nao podes compartilhar todas as suas areas com todos.
@1 already has now access to all your areas.=@1 ja possui agora acesso a todas suas areas. @1 already has now access to all your areas.=@1 ja possui agora acesso a todas suas areas.
@1 shared all areas with you.=@1 compartilhou todas as areas contigo. @1 shared all areas with you.=@1 compartilhou todas as areas contigo.
@1 has now access to all your areas.=@1 agora tem acesso a todas suas areas. @1 has now access to all your areas.=@1 agora tem acesso a todas suas areas.
# /area unshareall <name> # /area unshareall <name>
@1 does not have access to any of your areas.=@1 nao tem acesso a nenhuma de suas areas. @1 does not have access to any of your areas.=@1 nao tem acesso a nenhuma de suas areas.
@1 unshared all areas with you.=@1 descompartilhou todas areas contigo. @1 unshared all areas with you.=@1 descompartilhou todas areas contigo.
@1 has no longer access to your areas.=@1 deixou de ter acesso a todas suas areas. @1 has no longer access to your areas.=@1 deixou de ter acesso a todas suas areas.
# /area unclaim # /area unclaim
This area is unowned now.=Essa area deixou de ser reivindicada agora. This area is unowned now.=Essa area deixou de ser reivindicada agora.
# /area delete <name> # /area delete <name>
Missing privilege: @1=Perderam o privilegio: @1 Missing privilege: @1=Perderam o privilegio: @1
Removed=Removido
Globally shared areas=Areas compartilhadas globalmente Globally shared areas=Areas compartilhadas globalmente
@1 claimed area(s)=@1 area(s) reivindicada(s) @1 claimed area(s)=@1 area(s) reivindicada(s)
@1 does not own any claimed areas.=@1 nao possui nenhuma area reivindicada. @1 does not own any claimed areas.=@1 nao possui nenhuma area reivindicada.
Removed=Removido
# /area list [name] This command is not available.=
#This command is not available. = Listing all areas of @1. Amount: @2=
#Listing all areas of @1. Amount: @2 = Share this area=
Remove an area share=
Share all areas=
#### Protection #### Remove all area shares=
Also removes individual area shares=
# Item place information Requires the '@1' privilege=
Area owned by: @1=Area possuida por: @1 List all areas=
# Hud text # Hud text
Area owner: @1=Area de: @1 Area owner: @1=Area de: @1
Allows to modify and delete protected areas=Permitir modificar e deletar areas protegidas
Please claim this area to modify it.=
# Item place information
Area owned by: @1=Area possuida por: @1
# Item: Claim stick # Item: Claim stick
Claim Stick=Graveto Reivindicador Claim Stick=Graveto Reivindicador
(click to protect)=
#(click to protect) = #(click to protect) =
This area is already protected by an other protection mod.=Essa area ja foi protegida por um outro mod protetor. This area is already protected by an other protection mod.=Essa area ja foi protegida por um outro mod protetor.
You can not claim areas below @1.=Nao podes reivindicar areas abaixo @1. You can not claim areas below @1.=Nao podes reivindicar areas abaixo @1.
This area is already owned by: @1=Essa area ja foi reivindicada por: @1. This area is already owned by: @1=Essa area ja foi reivindicada por: @1.
You can not claim any further areas: Limit (@1) reached.=
Congratulations! You now own this area.=Parabens! Agora reivindicaste essa area. Congratulations! You now own this area.=Parabens! Agora reivindicaste essa area.
#You can not claim any further areas: Limit (@1) reached. = North @1=
#Please claim this area to modify it. = West @1=
South @1=
East @1=
#### Shared Chest #### square @= 1 area @= @1x@2x@3 nodes (X,Y,Z)=
Your position=
#Shared Chest = Your area=
#(by protection) = Area claimed@nNo access for you=
Access for everybody=
One area unit (@1m) up/down@n-> no claims on this Y level=

View File

@ -1,15 +1,8 @@
# textdomain: simple_protection # textdomain: simple_protection
# Translated by: YOURNAME Shared Chest=
(by protection)=
# Privilege description
Allows to modify and delete protected areas=
#### AREA COMMAND ####
# Command description # Command description
Manages all of your areas.= Manages all of your areas.=
# /area # /area
Available area commands= Available area commands=
Information about this area= Information about this area=
@ -17,16 +10,10 @@ View of surrounding areas=
(Un)share one area= (Un)share one area=
(Un)share all areas= (Un)share all areas=
List claimed areas= List claimed areas=
Delete all areas of a player=
Unclaim this area= Unclaim this area=
Delete all areas of a player=
# Errors of /area # Errors of /area
Unknown command parameter: @1. Check '/area' for correct usage.= Unknown command parameter: @1. Check '/area' for correct usage.=
No player name given.=
Unknown player.=
This area is not claimed yet.=
You do not own this area.=
# /area show # /area show
Vertical from Y @1 to @2= Vertical from Y @1 to @2=
Area status: @1= Area status: @1=
@ -34,75 +21,73 @@ Not claimable=
Unowned (!)= Unowned (!)=
Owned by @1= Owned by @1=
Players with access: @1= Players with access: @1=
This area is not claimed yet.=
# /area radar You do not own this area.=
North @1= No player name given.=
East @1= Unknown player.=
South @1=
West @1=
Your position=
Your area=
Area claimed\nNo access for you=
Access for everybody=
One area unit (@1m) up/down\n-> no claims on this Y level=
square \= 1 area \= @1x@2x@3 nodes (X,Y,Z)=
# /area share <name> # /area share <name>
@1 already has access to all your areas.= @1 already has access to all your areas.=
@1 already has access to this area.= @1 already has access to this area.=
@1 shared an area with you.= @1 shared an area with you.=
@1 has now access to this area.= @1 has now access to this area.=
# /area unshare <name> # /area unshare <name>
That player has no access to this area.= That player has no access to this area.=
@1 unshared an area with you.= @1 unshared an area with you.=
@1 has no longer access to this area.= @1 has no longer access to this area.=
# /area shareall <name> # /area shareall <name>
You can not share all your areas with everybody.= You can not share all your areas with everybody.=
@1 already has now access to all your areas.= @1 already has now access to all your areas.=
@1 shared all areas with you.= @1 shared all areas with you.=
@1 has now access to all your areas.= @1 has now access to all your areas.=
# /area unshareall <name> # /area unshareall <name>
@1 does not have access to any of your areas.= @1 does not have access to any of your areas.=
@1 unshared all areas with you.= @1 unshared all areas with you.=
@1 has no longer access to your areas.= @1 has no longer access to your areas.=
# /area unclaim # /area unclaim
This area is unowned now.= This area is unowned now.=
# /area delete <name> # /area delete <name>
Missing privilege: @1= Missing privilege: @1=
Removed=
Globally shared areas= Globally shared areas=
@1 claimed area(s)= @1 claimed area(s)=
@1 does not own any claimed areas.= @1 does not own any claimed areas.=
Removed=
# /area list [name] # /area list [name]
This command is not available.= This command is not available.=
Listing all areas of @1. Amount: @2= Listing all areas of @1. Amount: @2=
Share this area=
Remove an area share=
#### Protection #### Share all areas=
Remove all area shares=
# Item place information Also removes individual area shares=
Area owned by: @1= Requires the '@1' privilege=
List all areas=
# Hud text # Hud text
Area owner: @1= Area owner: @1=
Allows to modify and delete protected areas=
Please claim this area to modify it.=
# Item place information
Area owned by: @1=
# Item: Claim stick # Item: Claim stick
Claim Stick= Claim Stick=
(click to protect)= (click to protect)=
This area is already protected by an other protection mod.= This area is already protected by an other protection mod.=
You can not claim areas below @1.= You can not claim areas below @1.=
This area is already owned by: @1= This area is already owned by: @1=
Congratulations! You now own this area.=
You can not claim any further areas: Limit (@1) reached.= You can not claim any further areas: Limit (@1) reached.=
Please claim this area to modify it.= Congratulations! You now own this area.=
# /area radar
North @1=
West @1=
South @1=
East @1=
square @= 1 area @= @1x@2x@3 nodes (X,Y,Z)=
Your position=
Your area=
Area claimed@nNo access for you=
Access for everybody=
One area unit (@1m) up/down@n-> no claims on this Y level=
#### Shared Chest #### ##### not used anymore #####
Shared Chest= square \= 1 area \= @1x@2x@3 nodes (X,Y,Z)=
(by protection)=

View File

@ -10,8 +10,9 @@ Configuration loading
-- Cache for performance -- Cache for performance
local get_player_privs = minetest.get_player_privs local get_player_privs = minetest.get_player_privs
local registered_on_access = {} local registered_on_access = {}
local sp = simple_protection
s_protect.can_access = function(pos, player_name) sp.can_access = function(pos, player_name)
if not player_name then if not player_name then
return false return false
end end
@ -28,21 +29,21 @@ s_protect.can_access = function(pos, player_name)
end end
-- Data of current area -- Data of current area
local data = s_protect.get_claim(pos) local data = sp.get_claim(pos)
-- Area is not claimed -- Area is not claimed
if not data then if not data then
-- Allow digging when claiming is not forced -- Allow digging when claiming is not forced
if not s_protect.claim_to_dig then if not sp.claim_to_dig then
return true return true
end end
-- Must claim everywhere? Disallow everywhere. -- Must claim everywhere? Disallow everywhere.
if not s_protect.underground_limit then if not sp.underground_limit then
return false return false
end end
-- Is it in claimable area? Yes? Disallow. -- Is it in claimable area? Yes? Disallow.
if pos.y >= s_protect.underground_limit then if pos.y >= sp.underground_limit then
return false return false
end end
return true return true
@ -72,42 +73,41 @@ s_protect.can_access = function(pos, player_name)
end end
-- Owner shared the area with the player -- Owner shared the area with the player
if s_protect.is_shared(data.owner, player_name) then if sp.is_shared(data.owner, player_name) then
return true return true
end end
-- Globally shared area -- Globally shared area
if s_protect.is_shared(data, player_name) then if sp.is_shared(data, player_name) then
return true return true
end end
if s_protect.is_shared(data, "*all") then if sp.is_shared(data, "*all") then
return true return true
end end
return false return false
end end
s_protect.register_on_access = function(func) sp.register_on_access = function(func)
registered_on_access[#registered_on_access + 1] = func registered_on_access[#registered_on_access + 1] = func
end end
s_protect.get_location = function(pos_) sp.get_location = function(pos_)
local pos = vector.round(pos_) local pos = vector.round(pos_)
return vector.floor({ return vector.floor({
x = pos.x / s_protect.claim_size, x = pos.x / sp.claim_size,
y = (pos.y + s_protect.start_underground) / s_protect.claim_height, y = (pos.y + sp.start_underground) / sp.claim_height,
z = pos.z / s_protect.claim_size z = pos.z / sp.claim_size
}) })
end end
local get_location = s_protect.get_location sp.get_area_bounds = function(pos_)
s_protect.get_area_bounds = function(pos_) local cs = sp.claim_size
local cs = s_protect.claim_size local cy = sp.claim_height
local cy = s_protect.claim_height
local p = get_location(pos_) local p = sp.get_location(pos_)
local minp = { local minp = {
x = p.x * cs, x = p.x * cs,
y = p.y * cy - s_protect.start_underground, y = p.y * cy - sp.start_underground,
z = p.z * cs z = p.z * cs
} }
local maxp = { local maxp = {
@ -119,8 +119,8 @@ s_protect.get_area_bounds = function(pos_)
return minp, maxp return minp, maxp
end end
s_protect.get_center = function(pos1) sp.get_center = function(pos1)
local size = s_protect.claim_size local size = sp.claim_size
local pos = { local pos = {
x = pos1.x / size, x = pos1.x / size,
y = pos1.y + 1.5, y = pos1.y + 1.5,
@ -133,14 +133,14 @@ s_protect.get_center = function(pos1)
return pos return pos
end end
s_protect.load_config = function() sp.load_config = function()
-- Load defaults -- Load defaults
dofile(s_protect.mod_path.."/default_settings.lua") dofile(sp.mod_path.."/default_settings.lua")
local file = io.open(s_protect.conf, "r") local file = io.open(sp.conf, "r")
if not file then if not file then
-- Duplicate configuration file on first time -- Duplicate configuration file on first time
local src = io.open(s_protect.mod_path.."/default_settings.lua", "r") local src = io.open(sp.mod_path.."/default_settings.lua", "r")
file = io.open(s_protect.conf, "w") file = io.open(sp.conf, "w")
while true do while true do
local block = src:read(128) -- 128B at once local block = src:read(128) -- 128B at once
@ -157,28 +157,28 @@ s_protect.load_config = function()
io.close(file) io.close(file)
-- Load existing config -- Load existing config
local simple_protection = {} rawset(_G, "s_protect", {})
dofile(s_protect.conf) dofile(sp.conf)
-- Backwards compatibility -- Backwards compatibility
for k, v in pairs(simple_protection) do for k, v in pairs(s_protect) do
s_protect[k] = v sp[k] = v
end end
simple_protection = nil s_protect = nil
-- Sanity check individual settings -- Sanity check individual settings
assert((s_protect.claim_size % 2) == 0 and s_protect.claim_size >= 4, assert((sp.claim_size % 2) == 0 and sp.claim_size >= 4,
"claim_size must be even and >= 4") "claim_size must be even and >= 4")
assert(s_protect.claim_height >= 4, "claim_height must be >= 4") assert(sp.claim_height >= 4, "claim_height must be >= 4")
if s_protect.claim_heigh then if sp.claim_heigh then
minetest.log("warning", "[simple_protection] " minetest.log("warning", "[simple_protection] "
.. "Deprecated setting: claim_heigh") .. "Deprecated setting: claim_heigh")
s_protect.claim_height = s_protect.claim_heigh sp.claim_height = sp.claim_heigh
end end
if s_protect.underground_claim then if sp.underground_claim then
minetest.log("warning", "[simple_protection] " minetest.log("warning", "[simple_protection] "
.. "Deprecated setting: underground_claim") .. "Deprecated setting: underground_claim")
s_protect.underground_limit = nil sp.underground_limit = nil
end end
end end

View File

@ -6,11 +6,12 @@ Node placement checks
Claim Stick item definition Claim Stick item definition
]] ]]
local S = s_protect.translator local sp = simple_protection
local S = sp.translator
local function notify_player(pos, player_name) local function notify_player(pos, player_name)
local data = s_protect.get_claim(pos) local data = sp.get_claim(pos)
if not data and s_protect.claim_to_dig then if not data and sp.claim_to_dig then
minetest.chat_send_player(player_name, S("Please claim this area to modify it.")) minetest.chat_send_player(player_name, S("Please claim this area to modify it."))
elseif not data then elseif not data then
-- Access restricted by another protection mod. Not my job. -- Access restricted by another protection mod. Not my job.
@ -20,10 +21,10 @@ local function notify_player(pos, player_name)
end end
end end
s_protect.old_is_protected = minetest.is_protected sp.old_is_protected = minetest.is_protected
minetest.is_protected = function(pos, player_name) minetest.is_protected = function(pos, player_name)
if s_protect.can_access(pos, player_name) then if sp.can_access(pos, player_name) then
return s_protect.old_is_protected(pos, player_name) return sp.old_is_protected(pos, player_name)
end end
return true return true
end end
@ -41,34 +42,34 @@ minetest.register_craftitem("simple_protection:claim", {
end end
local player_name = user:get_player_name() local player_name = user:get_player_name()
local pos = pointed_thing.under local pos = pointed_thing.under
if s_protect.old_is_protected(pos, player_name) then if sp.old_is_protected(pos, player_name) then
minetest.chat_send_player(player_name, minetest.chat_send_player(player_name,
S("This area is already protected by an other protection mod.")) S("This area is already protected by an other protection mod."))
return return
end end
if s_protect.underground_limit then if sp.underground_limit then
local minp, maxp = s_protect.get_area_bounds(pos) local minp, maxp = sp.get_area_bounds(pos)
if minp.y < s_protect.underground_limit then if minp.y < sp.underground_limit then
minetest.chat_send_player(player_name, minetest.chat_send_player(player_name,
S("You can not claim areas below @1.", S("You can not claim areas below @1.",
s_protect.underground_limit .. "m")) sp.underground_limit .. "m"))
return return
end end
end end
local data, index = s_protect.get_claim(pos) local data, index = sp.get_claim(pos)
if data then if data then
minetest.chat_send_player(player_name, minetest.chat_send_player(player_name,
S("This area is already owned by: @1", data.owner)) S("This area is already owned by: @1", data.owner))
return return
end end
-- Count number of claims for this user -- Count number of claims for this user
local claims_max = s_protect.max_claims local claims_max = sp.max_claims
if minetest.check_player_privs(player_name, {simple_protection=true}) then if minetest.check_player_privs(player_name, {simple_protection=true}) then
claims_max = claims_max * 2 claims_max = claims_max * 2
end end
local claims, count = s_protect.get_player_claims(player_name) local claims, count = sp.get_player_claims(player_name)
if count >= claims_max then if count >= claims_max then
minetest.chat_send_player(player_name, minetest.chat_send_player(player_name,
S("You can not claim any further areas: Limit (@1) reached.", S("You can not claim any further areas: Limit (@1) reached.",
@ -77,11 +78,11 @@ minetest.register_craftitem("simple_protection:claim", {
end end
itemstack:take_item(1) itemstack:take_item(1)
s_protect.update_claims({ sp.update_claims({
[index] = {owner=player_name, shared={}} [index] = {owner=player_name, shared={}}
}) })
minetest.add_entity(s_protect.get_center(pos), "simple_protection:marker") minetest.add_entity(sp.get_center(pos), "simple_protection:marker")
minetest.chat_send_player(player_name, S("Congratulations! You now own this area.")) minetest.chat_send_player(player_name, S("Congratulations! You now own this area."))
return itemstack return itemstack
end, end,
@ -114,12 +115,12 @@ minetest.register_entity("simple_protection:marker",{
}) })
-- hacky - I'm not a regular node! -- hacky - I'm not a regular node!
local size = s_protect.claim_size / 2 local size = sp.claim_size / 2
minetest.register_node("simple_protection:mark", { minetest.register_node("simple_protection:mark", {
tiles = {"simple_protection_marker.png"}, tiles = {"simple_protection_marker.png"},
groups = {dig_immediate=3, not_in_creative_inventory=1}, groups = {dig_immediate=3, not_in_creative_inventory=1},
drop = "", drop = "",
use_texture_alpha = "clip", use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "clip" or true,
walkable = false, walkable = false,
drawtype = "nodebox", drawtype = "nodebox",
node_box = { node_box = {

View File

@ -1,5 +1,6 @@
-- /area radar -- /area radar
local S = s_protect.translator local sp = simple_protection
local S = sp.translator
local data_cache local data_cache
local function colorize_area(name, force) local function colorize_area(name, force)
@ -12,7 +13,7 @@ local function colorize_area(name, force)
data_cache.owner == name then data_cache.owner == name then
return "[colorize:#0F0:180" return "[colorize:#0F0:180"
end end
local is_shared = s_protect.is_shared local is_shared = sp.is_shared
if force == "shared" or not force and ( if force == "shared" or not force and (
is_shared(data_cache, name) is_shared(data_cache, name)
or is_shared(data_cache.owner, name)) then or is_shared(data_cache.owner, name)) then
@ -30,15 +31,15 @@ local function combine_escape(str)
return str:gsub("%^%[", "\\%^\\%["):gsub(":", "\\:") return str:gsub("%^%[", "\\%^\\%["):gsub(":", "\\:")
end end
s_protect.register_subcommand("radar", function(name) sp.register_subcommand("radar", function(name)
local player = minetest.get_player_by_name(name) local player = minetest.get_player_by_name(name)
local player_pos = player:get_pos() local player_pos = player:get_pos()
local pos = s_protect.get_location(player_pos) local pos = sp.get_location(player_pos)
local map_w = 15 - 1 local map_w = 15 - 1
local map_wh = map_w / 2 local map_wh = map_w / 2
local img_w = 20 local img_w = 20
local get_single = s_protect.get_claim local get_single = sp.get_claim
local function getter(x, ymod, z) local function getter(x, ymod, z)
data_cache = get_single(x .."," .. (pos.y + ymod) .. "," .. z, true) data_cache = get_single(x .."," .. (pos.y + ymod) .. "," .. z, true)
return data_cache return data_cache
@ -69,8 +70,8 @@ s_protect.register_subcommand("radar", function(name)
end end
-- Player's position marker (8x8 px) -- Player's position marker (8x8 px)
local pp_x = player_pos.x / s_protect.claim_size local pp_x = player_pos.x / sp.claim_size
local pp_z = player_pos.z / s_protect.claim_size local pp_z = player_pos.z / sp.claim_size
-- Get relative position to the map, add map center offset, center image -- Get relative position to the map, add map center offset, center image
pp_x = math.floor((pp_x - pos.x + map_wh) * img_w + 0.5) - 4 pp_x = math.floor((pp_x - pos.x + map_wh) * img_w + 0.5) - 4
pp_z = math.floor((pos.z - pp_z + map_wh + 1) * img_w + 0.5) - 4 pp_z = math.floor((pos.z - pp_z + map_wh + 1) * img_w + 0.5) - 4
@ -106,9 +107,9 @@ s_protect.register_subcommand("radar", function(name)
.. parts .. marker_str) .. parts .. marker_str)
.. dir_mod .. "]" .. .. dir_mod .. "]" ..
"label[0,6.8;1 " .. S("square = 1 area = @1x@2x@3 nodes (X,Y,Z)", "label[0,6.8;1 " .. S("square = 1 area = @1x@2x@3 nodes (X,Y,Z)",
s_protect.claim_size, sp.claim_size,
s_protect.claim_height, sp.claim_height,
s_protect.claim_size) .. "]" .. sp.claim_size) .. "]" ..
"image[6.25,1.25;0.5,0.5;object_marker_red.png]" .. "image[6.25,1.25;0.5,0.5;object_marker_red.png]" ..
"label[7,1.25;" .. S("Your position") .. "]" .. "label[7,1.25;" .. S("Your position") .. "]" ..
"image[6,2;1,1;simple_protection_radar.png^" "image[6,2;1,1;simple_protection_radar.png^"
@ -123,6 +124,6 @@ s_protect.register_subcommand("radar", function(name)
"image[6,5;1,1;simple_protection_radar_down.png]" .. "image[6,5;1,1;simple_protection_radar_down.png]" ..
"image[7,5;1,1;simple_protection_radar_up.png]" .. "image[7,5;1,1;simple_protection_radar_up.png]" ..
"label[6,6;" .. S("One area unit (@1m) up/down\n-> no claims on this Y level", "label[6,6;" .. S("One area unit (@1m) up/down\n-> no claims on this Y level",
s_protect.claim_height) .. "]" sp.claim_height) .. "]"
) )
end) end)