6 Commits

Author SHA1 Message Date
e0783cf8bf Corrige crash au démarrage 2020-06-15 01:10:47 +02:00
0b2baacb92 Merge remote-tracking branch 'upstream/master' into nalc-1.2-dev 2020-06-14 23:38:20 +02:00
54c504fa0d [areas] Remet le HUD comme avant la modif du feae996 2019-12-30 01:02:36 +01:00
26d6f56485 Ajoute description privilège \"megabuilder\" pour admins d'areas 2019-12-28 15:26:21 +01:00
57f20bb25f Ajoute infos privilège "megabuilder" dans la commande /area_info 2019-12-28 15:07:13 +01:00
feae9967dc Ajoute certaines modifications venant de MFF + ajustement HUD
* Aires openfarming
* Privilège megabuilder
* HUD légèrement modifié pour laisser de la place à celui de factions
2019-12-28 02:43:12 +01:00
12 changed files with 122 additions and 184 deletions

View File

@ -10,7 +10,7 @@ read_globals = {
"AreaStore", "AreaStore",
"default", "default",
"factions", "factions",
table = { fields = { "copy", "getn", "indexof" } } table = { fields = { "copy", "getn" } }
} }
globals = { globals = {

View File

@ -5,11 +5,6 @@ Dependencies
------------ ------------
Minetest 5.0.0+ is recommended, but 0.4.16+ should work as well. Minetest 5.0.0+ is recommended, but 0.4.16+ should work as well.
Minetest 5.0.0+
Optional support for following mods:
* [playerfactions](https://git.leagueh.xyz/katp32/playerfactions/) by [katp32](https://git.leagueh.xyz/katp32) & [Kalio_42](https://git.leagueh.xyz/Kalio_42)
Configuration Configuration
@ -106,22 +101,14 @@ Commands
* `/area_pos2 [X,Y,Z|X Y Z]` -- Sets area position two to your position or * `/area_pos2 [X,Y,Z|X Y Z]` -- Sets area position two to your position or
the one supplied. the one supplied.
* `/areas_cleanup` -- Removes all ownerless areas. * `/areas_cleanup` -- Removes all ownerless areas.
Useful for cleaning after user deletion, for example using /remove_player. Useful for cleaning after user deletion, for example using /remove_player.
* `/area_open <ID>` -- Toggle open/closed the specified area for everyone.
* `/area_faction_open <ID> <faction>` -- Toggle open/closed the specified
area for members of the faction. Factions are created and managed by
playerfactions mod.
License License
------- -------
Copyright (C) 2013-2017 ShadowNinja Copyright (C) 2013 ShadowNinja
Copyright (C) 2015-2020 various contributors
Licensed under the GNU LGPL version 2.1 or later. Licensed under the GNU LGPL version 2.1 or later.
See LICENSE.txt and http://www.gnu.org/licenses/lgpl-2.1.txt See LICENSE.txt and http://www.gnu.org/licenses/lgpl-2.1.txt

53
api.lua
View File

@ -1,5 +1,15 @@
local hudHandlers = {} local hudHandlers = {}
---plants to place in openfarming
local plants = {
["farming:blueberries"]="air", ["farming:carrot"]="air", ["farming:coffee_beans"]="air",
["farming:corn"]="air", ["farming:cucumber"]="air", ["farming:melon_slice"]="air",
["farming:potato"]="air", ["farming:pumpkin_slice"]="air", ["farming:raspberries"]="air",
["farming:rhubarb"]="air", ["farming:tomato"]="air", ["farming:seed_cotton"]="air",
["farming:seed_wheat"]="air",["default:papyrus"]="air", ["farming:trellis"]="air",
["farming:grapes"]="farming:trellis", ["farming:beanpole"]="air", ["farming:beans"]="farming:beanpole",
}
areas.registered_on_adds = {} areas.registered_on_adds = {}
areas.registered_on_removes = {} areas.registered_on_removes = {}
areas.registered_on_moves = {} areas.registered_on_moves = {}
@ -84,34 +94,35 @@ end
-- Checks if the area is unprotected or owned by you -- Checks if the area is unprotected or owned by you
function areas:canInteract(pos, name) function areas:canInteract(pos, name)
if name == "" then
return true -- Mods, namely minetest.item_place_node
end
if minetest.check_player_privs(name, self.adminPrivs) then if minetest.check_player_privs(name, self.adminPrivs) then
return true return true
end end
local owned = false
-- Disallow interaction by default when the restrictive setting is enabled
local owned = areas.config.require_protection
for _, area in pairs(self:getAreasAtPos(pos)) do for _, area in pairs(self:getAreasAtPos(pos)) do
if area.owner == name or area.open then if area.owner == name or area.open then
return true return true
elseif area.openfarming then
-- if area is openfarming
local node = minetest.get_node(pos).name
if not minetest.registered_nodes[node] then return false end
local player = minetest.get_player_by_name(name)
if not player then return false end
local wstack = player:get_wielded_item():get_name()
if wstack == "" then wstack = "hand" end
--on_dig
if minetest.get_item_group(node, "plant") == 1 and (wstack == "hand" or minetest.registered_tools[wstack]) then
return true
end
--on_place
if plants[wstack] ~= nil and plants[wstack] == node then
return true
end
elseif areas.factions_available and area.faction_open then elseif areas.factions_available and area.faction_open then
if (factions.version or 0) < 2 then local faction_name = factions.get_player_faction(area.owner)
local faction_name = factions.get_player_faction(name) if faction_name ~= nil and faction_name == factions.get_player_faction(name) then
if faction_name then return true
for _, fname in ipairs(area.faction_open or {}) do
if faction_name == fname then
return true
end
end
end
else
for _, fname in ipairs(area.faction_open or {}) do
if factions.player_is_in_faction(fname, name) then
return true
end
end
end end
end end
owned = true owned = true

View File

@ -284,17 +284,35 @@ minetest.register_chatcommand("area_open", {
}) })
minetest.register_chatcommand(
"area_openfarming", {
params = "<ID>",
description = "Toggle an area as open farming (anyone can harvest and plant) or closed",
func = function(name, param)
local id = tonumber(param)
if not id then
return false, "Invalid usage, see /help area_openfarming."
end
if not areas:isAreaOwner(id, name) then
return false, "Area "..id.." does not exist"
.." or is not owned by you."
end
local open = not areas.areas[id].openfarming
-- Save false as nil to avoid inflating the DB.
areas.areas[id].openfarming = open or nil
areas:save()
return true, ("Area %s to farming."):format(open and "opened" or "closed")
end
})
if areas.factions_available then if areas.factions_available then
minetest.register_chatcommand("area_faction_open", { minetest.register_chatcommand("area_faction_open", {
params = S("<ID> [faction_name]"), params = S("<ID>"),
description = S("Toggle an area open/closed for members in your faction."), description = S("Toggle an area open/closed for members in your faction."),
func = function(name, param) func = function(name, param)
local params = param:split(" ") local id = tonumber(param)
if not id then
local id = tonumber(params[1])
local faction_name = params[2]
if not id or not faction_name then
return false, S("Invalid usage, see /help @1.", "area_faction_open") return false, S("Invalid usage, see /help @1.", "area_faction_open")
end end
@ -302,25 +320,11 @@ if areas.factions_available then
return false, S("Area @1 does not exist" return false, S("Area @1 does not exist"
.." or is not owned by you.", id) .." or is not owned by you.", id)
end end
local open = not areas.areas[id].faction_open
if not factions.get_owner(faction_name) then -- Save false as nil to avoid inflating the DB.
return false, S("Faction doesn't exists") areas.areas[id].faction_open = open or nil
end
local fnames = areas.areas[id].faction_open or {}
local pos = table.indexof(fnames, faction_name)
if pos < 0 then
-- Add new faction to the list
table.insert(fnames, faction_name)
else
table.remove(fnames, pos)
end
if #fnames == 0 then
-- Save {} as nil to avoid inflating the DB.
fnames = nil
end
areas.areas[id].faction_open = fnames
areas:save() areas:save()
return true, fnames and S("Area is open for members of: @1", table.concat(fnames, ", ")) return true, open and S("Area opened for faction members.")
or S("Area closed for faction members.") or S("Area closed for faction members.")
end end
}) })
@ -393,7 +397,9 @@ minetest.register_chatcommand("area_info", {
elseif has_high_limit then elseif has_high_limit then
table.insert(lines, table.insert(lines,
S("You have extended area protection".. S("You have extended area protection"..
" limits (\"areas_high_limit\" privilege).")) " limits (\"areas_high_limit\" privilege)."))
elseif privs.megabuilder then
table.insert(lines, "You are a megabuilder (\"megabuilder\" privilege).")
end end
-- Area count -- Area count
@ -406,7 +412,7 @@ minetest.register_chatcommand("area_info", {
table.insert(lines, S("You have @1 areas.", area_num)) table.insert(lines, S("You have @1 areas.", area_num))
-- Area limit -- Area limit
local area_limit_line = privs.areas and local area_limit_line = (privs.areas or privs.megabuilder) and
S("Limit: no area count limit") or S("Limit: no area count limit") or
S("Limit: @1 areas", max_count) S("Limit: @1 areas", max_count)
table.insert(lines, area_limit_line) table.insert(lines, area_limit_line)
@ -427,6 +433,9 @@ minetest.register_chatcommand("area_info", {
limit, size_limit) limit, size_limit)
priv_limit_info("areas_high_limit", priv_limit_info("areas_high_limit",
limit_high, size_limit_high) limit_high, size_limit_high)
table.insert(lines, "Players with the \"megabuilder\" privilege can protect unlimited areas in size and number.")
elseif privs.megabuilder then
table.insert(lines, "You can protect areas unlimited in size and number.")
elseif has_prot_priv then elseif has_prot_priv then
size_info(S("You can protect areas"), max_size) size_info(S("You can protect areas"), max_size)
end end

29
hud.lua
View File

@ -20,32 +20,13 @@ minetest.register_globalstep(function(dtime)
local areaStrings = {} local areaStrings = {}
for id, area in pairs(areas:getAreasAtPos(pos)) do for id, area in pairs(areas:getAreasAtPos(pos)) do
local faction_info local faction_info = area.faction_open and areas.factions_available and
if area.faction_open and areas.factions_available then factions.get_player_faction(area.owner)
-- Gather and clean up disbanded factions area.faction_open = faction_info
local changed = false
for i, fac_name in ipairs(area.faction_open) do
if not factions.get_owner(fac_name) then
table.remove(area.faction_open, i)
changed = true
end
end
if #area.faction_open == 0 then
-- Prevent DB clutter, remove value
area.faction_open = nil
else
faction_info = table.concat(area.faction_open, ", ")
end
if changed then
areas:save()
end
end
table.insert(areaStrings, ("%s [%u] (%s%s%s)") table.insert(areaStrings, ("%s [%u] (%s%s%s)")
:format(area.name, id, area.owner, :format(area.name, id, area.owner,
area.open and S(":open") or "", area.open and S(":open") or area.openfarming and ":openfarming" or "",
faction_info and ": "..faction_info or "")) faction_info and ":"..faction_info or ""))
end end
for i, area in pairs(areas:getExternalHudEntries(pos)) do for i, area in pairs(areas:getExternalHudEntries(pos)) do

View File

@ -4,7 +4,7 @@
areas = {} areas = {}
areas.factions_available = minetest.get_modpath("playerfactions") and true areas.factions_available = minetest.global_exists("factions")
areas.adminPrivs = {areas=true} areas.adminPrivs = {areas=true}
areas.startTime = os.clock() areas.startTime = os.clock()
@ -16,27 +16,25 @@ dofile(areas.modpath.."/internal.lua")
dofile(areas.modpath.."/chatcommands.lua") dofile(areas.modpath.."/chatcommands.lua")
dofile(areas.modpath.."/pos.lua") dofile(areas.modpath.."/pos.lua")
dofile(areas.modpath.."/interact.lua") dofile(areas.modpath.."/interact.lua")
if areas.config.node_ownership_legacy then dofile(areas.modpath.."/legacy.lua")
dofile(areas.modpath.."/legacy.lua")
end
dofile(areas.modpath.."/hud.lua") dofile(areas.modpath.."/hud.lua")
areas:load() areas:load()
local S = minetest.get_translator("areas")
minetest.register_privilege("areas", { minetest.register_privilege("areas", {
description = S("Can administer areas."), description = "Can administer areas."
give_to_singleplayer = false
}) })
minetest.register_privilege("areas_high_limit", { minetest.register_privilege("areas_high_limit", {
description = S("Can protect more, bigger areas."), description = "Can protect more, bigger areas."
give_to_singleplayer = false })
-- Mega_builder privilege -- MFF
minetest.register_privilege("megabuilder", {
description = "Can protect an infinite amount of areas."
}) })
if not minetest.registered_privileges[areas.config.self_protection_privilege] then if not minetest.registered_privileges[areas.config.self_protection_privilege] then
minetest.register_privilege(areas.config.self_protection_privilege, { minetest.register_privilege(areas.config.self_protection_privilege, {
description = S("Can protect areas."), description = "Can protect areas.",
}) })
end end

View File

@ -9,20 +9,11 @@ function minetest.is_protected(pos, name)
end end
minetest.register_on_protection_violation(function(pos, name) minetest.register_on_protection_violation(function(pos, name)
if areas:canInteract(pos, name) then if not areas:canInteract(pos, name) then
return local owners = areas:getNodeOwners(pos)
end
local owners = areas:getNodeOwners(pos)
if #owners == 0 then
-- When require_protection=true
minetest.chat_send_player(name, minetest.chat_send_player(name,
S("@1 may not be accessed.", S("@1 is protected by @2.",
minetest.pos_to_string(pos))) minetest.pos_to_string(pos),
return table.concat(owners, ", ")))
end end
minetest.chat_send_player(name,
S("@1 is protected by @2.",
minetest.pos_to_string(pos),
table.concat(owners, ", ")))
end) end)

View File

@ -18,7 +18,7 @@ end
-- Save the areas table to a file -- Save the areas table to a file
function areas:save() function areas:save()
local datastr = minetest.write_json(self.areas) local datastr = minetest.serialize(self.areas)
if not datastr then if not datastr then
minetest.log("error", "[areas] Failed to serialize area data!") minetest.log("error", "[areas] Failed to serialize area data!")
return return
@ -33,19 +33,10 @@ function areas:load()
self.areas = self.areas or {} self.areas = self.areas or {}
return err return err
end end
local data = file:read("*a") self.areas = minetest.deserialize(file:read("*a"))
if data:sub(1, 1) == "[" then
self.areas, err = minetest.parse_json(data)
else
self.areas, err = minetest.deserialize(data)
end
if type(self.areas) ~= "table" then if type(self.areas) ~= "table" then
self.areas = {} self.areas = {}
end end
if err and #data > 10 then
minetest.log("error", "[areas] Failed to load area data: " ..
tostring(err))
end
file:close() file:close()
self:populateStore() self:populateStore()
end end
@ -225,24 +216,27 @@ function areas:canPlayerAddArea(pos1, pos2, name)
.." the necessary privilege.") .." the necessary privilege.")
end end
local max_size = privs.areas_high_limit and -- MFF: megabuilders skip checks on size and number of areas
if not privs.megabuilder then
local max_size = privs.areas_high_limit and
self.config.self_protection_max_size_high or self.config.self_protection_max_size_high or
self.config.self_protection_max_size self.config.self_protection_max_size
if if
(pos2.x - pos1.x) > max_size.x or (pos2.x - pos1.x) > max_size.x or
(pos2.y - pos1.y) > max_size.y or (pos2.y - pos1.y) > max_size.y or
(pos2.z - pos1.z) > max_size.z then (pos2.z - pos1.z) > max_size.z then
return false, S("Area is too big.") return false, S("Area is too big.")
end
-- Check number of areas the user has and make sure it not above the max
local count = 0
for _, area in pairs(self.areas) do
if area.owner == name then
count = count + 1
end end
end end
local max_areas = privs.areas_high_limit and
-- Check number of areas the user has and make sure it not above the max
local count = 0
for _, area in pairs(self.areas) do
if area.owner == name then
count = count + 1
end
end
local max_areas = privs.areas_high_limit and
self.config.self_protection_max_areas_high or self.config.self_protection_max_areas_high or
self.config.self_protection_max_areas self.config.self_protection_max_areas
if count >= max_areas then if count >= max_areas then
@ -257,7 +251,6 @@ function areas:canPlayerAddArea(pos1, pos2, name)
return false, S("The area intersects with @1 [@2] (@3).", return false, S("The area intersects with @1 [@2] (@3).",
area.name, id, area.owner) area.name, id, area.owner)
end end
return true return true
end end

View File

@ -1,11 +1,9 @@
# textdomain: areas # textdomain: areas
### chatcommands.lua ### ### chatcommands.lua ###
<AreaName>=<NomZone> <AreaName>=<NomZone>
<ID> [faction_name]=<ID> [nom_de_faction]
<NewOwner>=<NouveauPropriétaire> <NewOwner>=<NouveauPropriétaire>
<ParentID>=<IDZonePrincipale> <ParentID>=<IDZonePrincipale>
<PlayerName>=<NomJoueur> <PlayerName>=<NomJoueur>
@ -17,13 +15,12 @@ Area @1 does not exist or is not owned by you.=La zone @1 nexiste pas ou ne v
Area closed for faction members.=Zone fermée aux membres de la faction. Area closed for faction members.=Zone fermée aux membres de la faction.
Area closed.=Zone fermée. Area closed.=Zone fermée.
Area does not exist.=La zone nexiste pas. Area does not exist.=La zone nexiste pas.
Area is open for members of: @1=Zone ouverte aux membres de ces factions : @1 Area opened for faction members.=Zone ouverte aux membres de la faction.
Area opened.=Zone ouverte. Area opened.=Zone ouverte.
Area protected. ID: @1=Zone protégée. ID : @1 Area protected. ID: @1=Zone protégée. ID : @1
Area renamed.=Zone renommée. Area renamed.=Zone renommée.
Area successfully moved.=Zone déplacée avec succès. Area successfully moved.=Zone déplacée avec succès.
Change the owner of an area using its ID=Change le propriétaire dune zone en utilisant son ID. Change the owner of an area using its ID=Change le propriétaire dune zone en utilisant son ID.
Faction doesn't exists=La faction n'existe pas
Find areas using a Lua regular expression=Trouve les zones en utilisant une expression régulière Lua. Find areas using a Lua regular expression=Trouve les zones en utilisant une expression régulière Lua.
Get information about area configuration and usage.=Obtient des informations sur la configuration des zones et lutilisation des zones. Get information about area configuration and usage.=Obtient des informations sur la configuration des zones et lutilisation des zones.
@ -46,7 +43,6 @@ Recursively remove areas using an ID=Supprime les zones récursivement en utilis
Remove an area using an ID=Supprime une zone en utilisant son ID. Remove an area using an ID=Supprime une zone en utilisant son ID.
Removed area @1=Zone @1 supprimée. Removed area @1=Zone @1 supprimée.
Removed area @1 and it's sub areas.=Zone @1 et ses sous-zones supprimées. Removed area @1 and it's sub areas.=Zone @1 et ses sous-zones supprimées.
Removes all ownerless areas=Supprime toutes les zones sans propriétaire
Rename an area that you own=Renomme une zone qui vous appartient. Rename an area that you own=Renomme une zone qui vous appartient.
Self protection is disabled.=Lautoprotection est désactivée. Self protection is disabled.=Lautoprotection est désactivée.
Self protection is enabled.=Lautoprotection est activée. Self protection is enabled.=Lautoprotection est activée.
@ -80,12 +76,6 @@ Invalid usage, see /help @1.=Utilisation incorrecte, voir /help @1.
:open= : ouverte :open= : ouverte
Areas:=Zones : Areas:=Zones :
### init.lua ###
Can administer areas.=Permet dadministrer des zones.
Can protect areas.=Permet de protéger des zones.
Can protect more, bigger areas.=Permet de protéger plus, et de plus grandes zones.
### interact.lua ### ### interact.lua ###
@1 is protected by @2.=@1 est protégée par @2. @1 is protected by @2.=@1 est protégée par @2.

View File

@ -1,11 +1,9 @@
# textdomain: areas # textdomain: areas
### chatcommands.lua ### ### chatcommands.lua ###
<AreaName>=<NomeArea> <AreaName>=<NomeArea>
<ID> [faction_name]= <ID> [nome_fazione]
<NewOwner>=<NuovoProprietario> <NewOwner>=<NuovoProprietario>
<ParentID>=<IDparent> <ParentID>=<IDparent>
<PlayerName>=<NomeGiocatore> <PlayerName>=<NomeGiocatore>
@ -17,13 +15,12 @@ Area @1 does not exist or is not owned by you.=L'area @1 non esiste o non è di
Area closed for faction members.=Area chiusa per i membri della fazione. Area closed for faction members.=Area chiusa per i membri della fazione.
Area closed.=Area chiusa. Area closed.=Area chiusa.
Area does not exist.=L'area non esiste. Area does not exist.=L'area non esiste.
Area is open for members of: @1=L'area è aperta ai membri di: @1 Area opened for faction members.=Area aperta per i membri della fazione.
Area opened.=Area aperta. Area opened.=Area aperta.
Area protected. ID: @1=Area protetta. ID: @1 Area protected. ID: @1=Area protetta. ID: @1
Area renamed.=Area rinominata. Area renamed.=Area rinominata.
Area successfully moved.=Area spostata con successo. Area successfully moved.=Area spostata con successo.
Change the owner of an area using its ID=Cambia il proprietario di un'area usando il suo ID Change the owner of an area using its ID=Cambia il proprietario di un'area usando il suo ID
Faction doesn't exists=La fazione non esiste
Find areas using a Lua regular expression=Trova aree usando una espressione regolare Lua Find areas using a Lua regular expression=Trova aree usando una espressione regolare Lua
Get information about area configuration and usage.=Ottieni informazioni sulla configurazione e l'uso delle aree. Get information about area configuration and usage.=Ottieni informazioni sulla configurazione e l'uso delle aree.
@ -46,7 +43,6 @@ Recursively remove areas using an ID=Elimina ricorsivamente delle aree usando un
Remove an area using an ID=Elimina un'area usando un ID Remove an area using an ID=Elimina un'area usando un ID
Removed area @1=Eliminata l'area @1 Removed area @1=Eliminata l'area @1
Removed area @1 and it's sub areas.=Eliminata l'area @1 e le sue sotto-aree. Removed area @1 and it's sub areas.=Eliminata l'area @1 e le sue sotto-aree.
Removes all ownerless areas=
Rename an area that you own=Rinomina un'area che ti appartiene Rename an area that you own=Rinomina un'area che ti appartiene
Self protection is disabled.=L'auto-protezione è disattivata. Self protection is disabled.=L'auto-protezione è disattivata.
Self protection is enabled.=L'auto-protezione è attivata. Self protection is enabled.=L'auto-protezione è attivata.
@ -80,12 +76,6 @@ Invalid usage, see /help @1.=Utilizzo non valido, si veda /help @1.
:open=:aperta :open=:aperta
Areas:=Aree: Areas:=Aree:
### init.lua ###
Can administer areas.=
Can protect areas.=
Can protect more, bigger areas.=
### interact.lua ### ### interact.lua ###
@1 is protected by @2.=@1 è protetta da @2. @1 is protected by @2.=@1 è protetta da @2.
@ -121,7 +111,7 @@ unnamed=innominato
Area @1 selected.=Area @1 selezionata. Area @1 selected.=Area @1 selezionata.
Area position @1 set to @2=Posizione @1 dell'area impostata a @2 Area position @1 set to @2=Posizione @1 dell'area impostata a @2
Position @1 set to @2=Posizione @1 impostata a @2 Position @1 set to @2=Posizione @1 impostata a @2
Position @1: =Posizione @1: Position @1: =Posizione @1:
Select an area by ID.=Scegli un'area tramite l'ID. Select an area by ID.=Scegli un'area tramite l'ID.
Select position @1 by punching a node.=Seleziona la posizione @1 colpendo un nodo. Select position @1 by punching a node.=Seleziona la posizione @1 colpendo un nodo.
Select positions by punching two nodes.=Seleziona le posizioni colpendo due nodi. Select positions by punching two nodes.=Seleziona le posizioni colpendo due nodi.

View File

@ -1,11 +1,9 @@
# textdomain: areas # textdomain: areas
### chatcommands.lua ### ### chatcommands.lua ###
<AreaName>= <AreaName>=
<ID> [faction_name]=
<NewOwner>= <NewOwner>=
<ParentID>= <ParentID>=
<PlayerName>= <PlayerName>=
@ -17,13 +15,12 @@ Area @1 does not exist or is not owned by you.=
Area closed for faction members.= Area closed for faction members.=
Area closed.= Area closed.=
Area does not exist.= Area does not exist.=
Area is open for members of: @1= Area opened for faction members.=
Area opened.= Area opened.=
Area protected. ID: @1= Area protected. ID: @1=
Area renamed.= Area renamed.=
Area successfully moved.= Area successfully moved.=
Change the owner of an area using its ID= Change the owner of an area using its ID=
Faction doesn't exists=
Find areas using a Lua regular expression= Find areas using a Lua regular expression=
Get information about area configuration and usage.= Get information about area configuration and usage.=
@ -46,7 +43,6 @@ Recursively remove areas using an ID=
Remove an area using an ID= Remove an area using an ID=
Removed area @1= Removed area @1=
Removed area @1 and it's sub areas.= Removed area @1 and it's sub areas.=
Removes all ownerless areas=
Rename an area that you own= Rename an area that you own=
Self protection is disabled.= Self protection is disabled.=
Self protection is enabled.= Self protection is enabled.=
@ -69,6 +65,8 @@ You have extended area protection limits ("areas_high_limit" privilege).=
You have the necessary privilege ("@1").= You have the necessary privilege ("@1").=
You need to select an area first.= You need to select an area first.=
Removes all ownerless areas.=
### chatcommands.lua ### ### chatcommands.lua ###
### pos.lua ### ### pos.lua ###
@ -80,12 +78,6 @@ Invalid usage, see /help @1.=
:open= :open=
Areas:= Areas:=
### init.lua ###
Can administer areas.=
Can protect areas.=
Can protect more, bigger areas.=
### interact.lua ### ### interact.lua ###
@1 is protected by @2.= @1 is protected by @2.=

View File

@ -8,34 +8,30 @@
areas.self_protection (Self protection) bool false areas.self_protection (Self protection) bool false
# Self protection: Privilege required to protect an area # Self protection: Privilege required to protect an area
areas.self_protection_privilege (Self protection: Required priv) string interact areas.self_protection_privilege (Self protection: Required privs) string interact
# Limits interactions of players to the areas they have access to. # Refresh delay for the name displays in the HUD in seconds
# This setting is very restrictive and is not recommended for open-world games.
areas.require_protection (Require protection) bool false
# Area name HUD refresh delay in seconds
areas.tick (HUD update delay) float 0.5 0 100 areas.tick (HUD update delay) float 0.5 0 100
# Enable the legacy owner_defs metatable mode. Untested and possibly unstable # Enable the legacy owner_defs metatable mode. Untested and possibly unstable
areas.node_ownership_legacy (node_ownership compatibility) bool false areas.legacy_table (Legacy owner_defs metatable) bool false
[Self protection (normal)] [Self protection (normal)]
# Maximal size of the protectable area # Self protection (normal): Maximal size of the protectable area
# Only enter positive whole numbers for the coordinate values or you'll mess up stuff. # Only enter positive whole numbers for the coordinate values or you'll mess up stuff.
areas.self_protection_max_size (Maximal area size) v3f (64, 128, 64) areas.self_protection_max_size (Maximal area size) v3f (64, 128, 64)
# Maximal amount of protected areas per player # Self protection (normal): Maximal amount of protected areas per player
areas.self_protection_max_areas (Maximal area count) int 4 areas.self_protection_max_areas (Maximal area count) int 4
[Self protection (high)] [Self protection (high)]
# For players with the 'areas_high_limit' privilege. # Self protection (normal): Maximal size of the protectable area
# Maximal size of the protectable area # This setting applies for plyaers with the privilege 'areas_high_limit'
# This setting applies for players with the privilege 'areas_high_limit'
areas.self_protection_max_size_high (Maximal area size) v3f (512, 512, 512) areas.self_protection_max_size_high (Maximal area size) v3f (512, 512, 512)
# For players with the 'areas_high_limit' privilege. # Self protection (normal): Maximal amount of protected areas per player
# Maximal amount of protected areas per player # Only enter positive whole numbers for the coordinate values or you'll mess up stuff.
# This setting applies for plyaers with the privilege 'areas_high_limit'
areas.self_protection_max_areas_high (Maximal area count) float 32 areas.self_protection_max_areas_high (Maximal area count) float 32