forked from minetest-mods/areas
		
	Compare commits
	
		
			37 Commits
		
	
	
		
			nalc-1.2.0
			...
			7f277db7ac
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 7f277db7ac | |||
| b129fb9494 | |||
|  | 8cb684da30 | ||
|  | 01c261cbe4 | ||
|  | 733e263f86 | ||
|  | c9f1cf2fac | ||
|  | 359280a353 | ||
|  | 79e799cfa1 | ||
|  | ec77a57f42 | ||
|  | d2b227eca6 | ||
|  | 9b6fea1473 | ||
|  | 3f30886972 | ||
|  | a38915f241 | ||
|  | 55594b65d8 | ||
|  | 6fd05bc95e | ||
| 2184118a4b | |||
| 0c9815460a | |||
|  | c2e3d073be | ||
|  | 9a5cdb2822 | ||
|  | 9024be24eb | ||
|  | 2deb6770f4 | ||
|  | 0bad0ec0ae | ||
|  | c044d49d21 | ||
|  | 2c900ef2cd | ||
|  | f4bb8eb29b | ||
| 2fda1adbd7 | |||
|  | cba647225c | ||
|  | c8cf4aba92 | ||
| 64b19c2594 | |||
|  | d464d3484f | ||
| a8cacee8cc | |||
| 76f8ccf8ab | |||
| 02b23b0371 | |||
|  | 4018c0d204 | ||
|  | c167b30ebf | ||
| 4eeb2a9d11 | |||
|  | a9c05f0e38 | 
| @@ -10,7 +10,7 @@ read_globals = { | |||||||
| 	"AreaStore", | 	"AreaStore", | ||||||
| 	"default", | 	"default", | ||||||
| 	"factions", | 	"factions", | ||||||
| 	table = { fields = { "copy", "getn" } } | 	table = { fields = { "copy", "getn", "indexof" } } | ||||||
| } | } | ||||||
|  |  | ||||||
| globals = { | globals = { | ||||||
|   | |||||||
							
								
								
									
										17
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								README.md
									
									
									
									
									
								
							| @@ -5,6 +5,11 @@ 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 | ||||||
| @@ -82,7 +87,7 @@ Commands | |||||||
|  |  | ||||||
|   * `/remove_area <ID>` -- Removes an area that you own. Any sub-areas of that |   * `/remove_area <ID>` -- Removes an area that you own. Any sub-areas of that | ||||||
| 	area are made sub-areas of the removed area's parent, if it exists. | 	area are made sub-areas of the removed area's parent, if it exists. | ||||||
| 	If the removed area has no parent it's sub-areas will have no parent. | 	If the removed area has no parent its sub-areas will have no parent. | ||||||
|  |  | ||||||
|   * `/recursive_remove_areas <ID>` -- Removes an area and all sub-areas of it. |   * `/recursive_remove_areas <ID>` -- Removes an area and all sub-areas of it. | ||||||
|  |  | ||||||
| @@ -105,10 +110,18 @@ Commands | |||||||
|   * `/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 ShadowNinja | Copyright (C) 2013-2017 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 | ||||||
|   | |||||||
							
								
								
									
										113
									
								
								api.lua
									
									
									
									
									
								
							
							
						
						
									
										113
									
								
								api.lua
									
									
									
									
									
								
							| @@ -2,18 +2,40 @@ local hudHandlers = {} | |||||||
|  |  | ||||||
| ---plants to place in openfarming | ---plants to place in openfarming | ||||||
| local plants = { | local plants = { | ||||||
| 	["farming:blueberries"]="air", ["farming:carrot"]="air", ["farming:coffee_beans"]="air", | 	["farming:beetroot"]="air", ["farming:blueberries"]="air", ["farming:cabbage"]="air", | ||||||
| 	["farming:corn"]="air", ["farming:cucumber"]="air", ["farming:melon_slice"]="air", | 	["farming:carrot"]="air", ["farming:chili_pepper"]="air", ["farming:coffee_beans"]="air", | ||||||
|  | 	["farming:corn"]="air", ["farming:cucumber"]="air", ["farming:garlic_clove"]="air", | ||||||
|  | 	["farming:melon_slice"]="air", ["farming:onion"]="air", ["default:papyrus"]="air", | ||||||
|  | 	["farming:pea_pod"]="air",	["farming:peppercorn"]="air", ["farming:pineapple_top"]="air", | ||||||
| 	["farming:potato"]="air", ["farming:pumpkin_slice"]="air", ["farming:raspberries"]="air", | 	["farming:potato"]="air", ["farming:pumpkin_slice"]="air", ["farming:raspberries"]="air", | ||||||
| 	["farming:rhubarb"]="air",	["farming:tomato"]="air", ["farming:seed_cotton"]="air", | 	["farming:rhubarb"]="air", | ||||||
| 	["farming:seed_wheat"]="air",["default:papyrus"]="air", ["farming:trellis"]="air", | 	["farming:seed_barley"]="air", ["farming:seed_cotton"]="air", ["farming:seed_hemp"]="air", | ||||||
| 	["farming:grapes"]="farming:trellis", ["farming:beanpole"]="air", ["farming:beans"]="farming:beanpole", | 	["farming:seed_mint"]="air", ["farming:seed_oat"]="air", ["farming:seed_rice"]="air", | ||||||
|  | 	["farming:seed_rye"]="air", ["farming:seed_wheat"]="air", | ||||||
|  | 	["farming:tomato"]="air", | ||||||
|  | 	["farming:trellis"]="air", ["farming:grapes"]="farming:trellis", | ||||||
|  | 	["farming:beanpole"]="air", ["farming:beans"]="farming:beanpole", | ||||||
|  | 	["morefarming:seed_wildcarrot"]="air", ["morefarming:seed_teosinte"]="air", | ||||||
|  | 	["morefarming:seed_carrot"]="air", ["morefarming:seed_corn"]="air", | ||||||
| } | } | ||||||
|  |  | ||||||
|  | areas.registered_protection_conditions = {} | ||||||
| areas.registered_on_adds = {} | areas.registered_on_adds = {} | ||||||
| areas.registered_on_removes = {} | areas.registered_on_removes = {} | ||||||
| areas.registered_on_moves = {} | areas.registered_on_moves = {} | ||||||
|  |  | ||||||
|  | areas.callback_origins = {} | ||||||
|  |  | ||||||
|  | function areas:registerProtectionCondition(func) | ||||||
|  | 	table.insert(areas.registered_protection_conditions, func) | ||||||
|  | 	local debug_info = debug.getinfo(func, "S") | ||||||
|  | 	areas.callback_origins[func] = { | ||||||
|  | 		mod = core.get_current_modname() or "??", | ||||||
|  | 		source = debug_info.short_src or "??", | ||||||
|  | 		line = debug_info.linedefined or "??" | ||||||
|  | 	} | ||||||
|  | end | ||||||
|  |  | ||||||
| function areas:registerOnAdd(func) | function areas:registerOnAdd(func) | ||||||
| 	table.insert(areas.registered_on_adds, func) | 	table.insert(areas.registered_on_adds, func) | ||||||
| end | end | ||||||
| @@ -92,37 +114,74 @@ function areas:getAreasIntersectingArea(pos1, pos2) | |||||||
| 	return res | 	return res | ||||||
| end | end | ||||||
|  |  | ||||||
| -- Checks if the area is unprotected or owned by you | -- Returns smallest area at position and its id or nil. | ||||||
|  | -- If multiple areas have the same volume, larger id takes precedence. | ||||||
|  | function areas:getSmallestAreaAtPos(pos) | ||||||
|  | 	local smallest_area, smallest_id, volume | ||||||
|  | 	local smallest_volume = math.huge | ||||||
|  | 	for id, area in pairs(self:getAreasAtPos(pos)) do | ||||||
|  | 		volume = (area.pos2.x - area.pos1.x + 1) | ||||||
|  | 				* (area.pos2.y - area.pos1.y + 1) | ||||||
|  | 				* (area.pos2.z - area.pos1.z + 1) | ||||||
|  | 		if smallest_volume >= volume then | ||||||
|  | 			smallest_area = area | ||||||
|  | 			smallest_id = id | ||||||
|  | 			smallest_volume = volume | ||||||
|  | 		end | ||||||
|  | 	end | ||||||
|  | 	return smallest_area, smallest_id | ||||||
|  | end | ||||||
|  |  | ||||||
|  | -- Checks if the area is unprotected, open[farming], owned by player | ||||||
|  | -- or player is part of faction of [smallest] area at position. | ||||||
| function areas:canInteract(pos, name) | function areas:canInteract(pos, name) | ||||||
| 	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 areas_list | ||||||
|  | 	if areas.config.use_smallest_area_precedence then | ||||||
|  | 		local smallest_area, _ = self:getSmallestAreaAtPos(pos) | ||||||
|  | 		areas_list = { smallest_area } | ||||||
|  | 	else | ||||||
|  | 		areas_list = self:getAreasAtPos(pos) | ||||||
|  | 	end | ||||||
| 	local owned = false | 	local owned = false | ||||||
| 	for _, area in pairs(self:getAreasAtPos(pos)) do | 	local player = minetest.get_player_by_name(name) | ||||||
|  | 	local node = minetest.get_node(pos).name | ||||||
|  | 	for _, area in pairs(areas_list) do | ||||||
|  | 		-- Player owns the area or area is open | ||||||
| 		if area.owner == name or area.open then | 		if area.owner == name or area.open then | ||||||
| 			return true | 			return true | ||||||
| 		elseif area.openfarming then | 		elseif area.openfarming then -- If area is openfarming | ||||||
| 			-- if area is openfarming | 			if player and minetest.registered_nodes[node] then | ||||||
| 			local node = minetest.get_node(pos).name | 				local wstack = player:get_wielded_item():get_name() | ||||||
| 			if not minetest.registered_nodes[node] then return false end | 				if wstack == "" then wstack = "hand" end | ||||||
| 			local player = minetest.get_player_by_name(name) | 				-- on_dig | ||||||
| 			if not player then return false end | 				if minetest.get_item_group(node, "plant") == 1 | ||||||
| 			local wstack = player:get_wielded_item():get_name() | 					and (wstack == "hand" or minetest.registered_tools[wstack]) then | ||||||
| 			if wstack == "" then wstack = "hand" end | 					return true | ||||||
|  | 				end | ||||||
| 			--on_dig | 				-- on_place | ||||||
| 			if minetest.get_item_group(node, "plant") == 1 and (wstack == "hand" or minetest.registered_tools[wstack]) then | 				if plants[wstack] ~= nil and plants[wstack] == node then | ||||||
| 				return true | 					return true | ||||||
| 			end | 				end | ||||||
|  |  | ||||||
| 			--on_place |  | ||||||
| 			if plants[wstack] ~= nil and plants[wstack] == node then |  | ||||||
| 				return true |  | ||||||
| 			end | 			end | ||||||
| 		elseif areas.factions_available and area.faction_open then | 		elseif areas.factions_available and area.faction_open then | ||||||
| 			local faction_name = factions.get_player_faction(area.owner) | 			if (factions.version or 0) < 2 then | ||||||
| 			if faction_name ~= nil and faction_name == factions.get_player_faction(name) then | 				local faction_name = factions.get_player_faction(name) | ||||||
| 				return true | 				if faction_name then | ||||||
|  | 					for _, fname in ipairs(area.faction_open) do | ||||||
|  | 						if faction_name == fname then | ||||||
|  | 							return true | ||||||
|  | 						end | ||||||
|  | 					end | ||||||
|  | 				end | ||||||
|  | 			else | ||||||
|  | 				for _, fname in ipairs(area.faction_open) do | ||||||
|  | 					if factions.player_is_in_faction(fname, name) then | ||||||
|  | 						return true | ||||||
|  | 					end | ||||||
|  | 				end | ||||||
| 			end | 			end | ||||||
| 		end | 		end | ||||||
| 		owned = true | 		owned = true | ||||||
|   | |||||||
							
								
								
									
										16
									
								
								api.md
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								api.md
									
									
									
									
									
								
							| @@ -5,11 +5,27 @@ API list | |||||||
| --- | --- | ||||||
|  |  | ||||||
|  * `areas:registerHudHandler(handler)` - Registers a handler to add items to the Areas HUD.  See [HUD](#hud). |  * `areas:registerHudHandler(handler)` - Registers a handler to add items to the Areas HUD.  See [HUD](#hud). | ||||||
|  |  * `areas:registerProtectionCondition(func(pos1, pos2, name))` -  | ||||||
|  | See [Protection Conditions](#Protection-Conditions) | ||||||
|  * `areas:registerOnAdd(func(id, area))` |  * `areas:registerOnAdd(func(id, area))` | ||||||
|  * `areas:registerOnRemove(func(id))` |  * `areas:registerOnRemove(func(id))` | ||||||
|  * `areas:registerOnMove(func(id, area, pos1, pos2))` |  * `areas:registerOnMove(func(id, area, pos1, pos2))` | ||||||
|  |  | ||||||
|  |  | ||||||
|  | Protection Conditions | ||||||
|  | --- | ||||||
|  |  | ||||||
|  | With `areas:registerProtectionCondition(func(pos1, pos2, name))` | ||||||
|  | you can register rules to control whether to allow or prohibit the creation of an area. | ||||||
|  |  | ||||||
|  | Return values: | ||||||
|  | * `true` Forcefully allows the area creation. This overwrites the outcome of any | ||||||
|  |   previously executed conditions, including the default ones registered by this mod. | ||||||
|  | * `false, errMsg` Disable the creation of the area and return an error message. | ||||||
|  | * `nil` (or no return value) Enable the creation of the area, | ||||||
|  |   unless specified otherwise by the other registered callbacks. | ||||||
|  |  | ||||||
|  |  | ||||||
| HUD | HUD | ||||||
| --- | --- | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										23
									
								
								async.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								async.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | |||||||
|  | areas = rawget(_G, "areas") or {} | ||||||
|  |  | ||||||
|  | local safe_file_write = core.safe_file_write | ||||||
|  | if safe_file_write == nil then | ||||||
|  |     safe_file_write = function(path, content) | ||||||
|  |         local file, err = io.open(path, "w") | ||||||
|  |         if err then | ||||||
|  |             return err | ||||||
|  |         end | ||||||
|  |         file:write(content) | ||||||
|  |         file:close() | ||||||
|  |     end | ||||||
|  | end | ||||||
|  |  | ||||||
|  | -- Save the areas table to a file | ||||||
|  | function areas._internal_do_save(areas_tb, filename) | ||||||
|  |     local datastr = core.write_json(areas_tb) | ||||||
|  |     if not datastr then | ||||||
|  |         core.log("error", "[areas] Failed to serialize area data!") | ||||||
|  |         return | ||||||
|  |     end | ||||||
|  |     return safe_file_write(filename, datastr) | ||||||
|  | end | ||||||
| @@ -71,7 +71,7 @@ minetest.register_chatcommand("set_owner", { | |||||||
|  |  | ||||||
| minetest.register_chatcommand("add_owner", { | minetest.register_chatcommand("add_owner", { | ||||||
| 	params = S("<ParentID>").." "..S("<PlayerName>").." "..S("<AreaName>"), | 	params = S("<ParentID>").." "..S("<PlayerName>").." "..S("<AreaName>"), | ||||||
| 	description = S("Give a player access to a sub-area beetween two" | 	description = S("Give a player access to a sub-area between two" | ||||||
| 		.." positions that have already been protected," | 		.." positions that have already been protected," | ||||||
| 		.." Use set_owner if you don't want the parent to be set."), | 		.." Use set_owner if you don't want the parent to be set."), | ||||||
| 	func = function(name, param) | 	func = function(name, param) | ||||||
| @@ -173,13 +173,46 @@ minetest.register_chatcommand("find_areas", { | |||||||
|  |  | ||||||
|  |  | ||||||
| minetest.register_chatcommand("list_areas", { | minetest.register_chatcommand("list_areas", { | ||||||
| 	description = S("List your areas, or all areas if you are an admin."), | 	params = S("[<name>]"), | ||||||
|  | 	description = S("List your areas. Admins can list all areas or those of a specific player."), | ||||||
| 	func = function(name, param) | 	func = function(name, param) | ||||||
| 		local admin = minetest.check_player_privs(name, areas.adminPrivs) | 		local admin = minetest.check_player_privs(name, areas.adminPrivs) | ||||||
|  | 		local admin_show_summary = admin | ||||||
|  | 		local owner_name = name | ||||||
|  |  | ||||||
|  | 		if admin and #param > 0 then | ||||||
|  | 			owner_name = param | ||||||
|  | 			admin_show_summary = false | ||||||
|  | 		end | ||||||
|  |  | ||||||
| 		local areaStrings = {} | 		local areaStrings = {} | ||||||
| 		for id, area in pairs(areas.areas) do | 		if admin_show_summary then | ||||||
| 			if admin or areas:isAreaOwner(id, name) then | 			-- Summary per-player | ||||||
| 				table.insert(areaStrings, areas:toString(id)) | 			local indices = {} | ||||||
|  | 			local counts = {} -- { [1] = name, [2] = count }, ... | ||||||
|  | 			for _, area in pairs(areas.areas) do | ||||||
|  | 				local i = indices[area.owner] | ||||||
|  | 				if i then | ||||||
|  | 					counts[i][2] = counts[i][2] + 1 | ||||||
|  | 				else | ||||||
|  | 					table.insert(counts, { area.owner, 1 }) | ||||||
|  | 					indices[area.owner] = #counts | ||||||
|  | 				end | ||||||
|  | 			end | ||||||
|  | 			-- Alphabatical name sorting | ||||||
|  | 			table.sort(counts, function (kv_a, kv_b) | ||||||
|  | 				return kv_a[1] < kv_b[1] | ||||||
|  | 			end) | ||||||
|  | 			--  Output | ||||||
|  | 			for _, kv in ipairs(counts) do | ||||||
|  | 				table.insert(areaStrings, S("@1 : @2 area(s)", kv[1], kv[2])) | ||||||
|  | 			end | ||||||
|  | 		else | ||||||
|  | 			-- Detailed list | ||||||
|  | 			for id, area in pairs(areas.areas) do | ||||||
|  | 				if areas:isAreaOwner(id, owner_name) then | ||||||
|  | 					table.insert(areaStrings, areas:toString(id)) | ||||||
|  | 				end | ||||||
| 			end | 			end | ||||||
| 		end | 		end | ||||||
| 		if #areaStrings == 0 then | 		if #areaStrings == 0 then | ||||||
| @@ -207,7 +240,7 @@ minetest.register_chatcommand("recursive_remove_areas", { | |||||||
|  |  | ||||||
| 		areas:remove(id, true) | 		areas:remove(id, true) | ||||||
| 		areas:save() | 		areas:save() | ||||||
| 		return true, S("Removed area @1 and it's sub areas.", id) | 		return true, S("Removed area @1 and its sub areas.", id) | ||||||
| 	end | 	end | ||||||
| }) | }) | ||||||
|  |  | ||||||
| @@ -308,11 +341,15 @@ minetest.register_chatcommand( | |||||||
|  |  | ||||||
| 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>"), | 		params = S("<ID> [faction_name]"), | ||||||
| 		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 id = tonumber(param) | 			local params = param:split(" ") | ||||||
| 			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 | ||||||
|  |  | ||||||
| @@ -320,11 +357,25 @@ 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 |  | ||||||
| 			-- Save false as nil to avoid inflating the DB. | 			if not factions.get_owner(faction_name) then | ||||||
| 			areas.areas[id].faction_open = open or nil | 				return false, S("Faction doesn't exists") | ||||||
|  | 			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, open and S("Area opened for faction members.") | 			return true, fnames and S("Area is open for members of: @1", table.concat(fnames, ", ")) | ||||||
| 				or S("Area closed for faction members.") | 				or S("Area closed for faction members.") | ||||||
| 		end | 		end | ||||||
| 	}) | 	}) | ||||||
|   | |||||||
							
								
								
									
										27
									
								
								hud.lua
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								hud.lua
									
									
									
									
									
								
							| @@ -20,9 +20,28 @@ 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 = area.faction_open and areas.factions_available and | 			local faction_info | ||||||
| 					factions.get_player_faction(area.owner) | 			if area.faction_open and areas.factions_available then | ||||||
| 			area.faction_open = faction_info | 				-- Gather and clean up disbanded factions | ||||||
|  | 				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.openfarming and ":openfarming" or "", | 					area.open and S(":open") or area.openfarming and ":openfarming" or "", | ||||||
| @@ -47,7 +66,7 @@ minetest.register_globalstep(function(dtime) | |||||||
| 			hud = {} | 			hud = {} | ||||||
| 			areas.hud[name] = hud | 			areas.hud[name] = hud | ||||||
| 			hud.areasId = player:hud_add({ | 			hud.areasId = player:hud_add({ | ||||||
| 				hud_elem_type = "text", | 				[minetest.features.hud_def_type_field and "type" or "hud_elem_type"] = "text", -- compatible with older versions | ||||||
| 				name = "Areas", | 				name = "Areas", | ||||||
| 				number = 0xFFFFFF, | 				number = 0xFFFFFF, | ||||||
| 				position = {x=0, y=1}, | 				position = {x=0, y=1}, | ||||||
|   | |||||||
							
								
								
									
										20
									
								
								init.lua
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								init.lua
									
									
									
									
									
								
							| @@ -4,14 +4,18 @@ | |||||||
|  |  | ||||||
| areas = {} | areas = {} | ||||||
|  |  | ||||||
| areas.factions_available = minetest.global_exists("factions") | areas.factions_available = minetest.get_modpath("playerfactions") and true | ||||||
|  |  | ||||||
| areas.adminPrivs = {areas=true} | areas.adminPrivs = {areas=true} | ||||||
| areas.startTime = os.clock() | local startTime = os.clock() | ||||||
|  |  | ||||||
| areas.modpath = minetest.get_modpath("areas") | areas.modpath = minetest.get_modpath("areas") | ||||||
| dofile(areas.modpath.."/settings.lua") | dofile(areas.modpath.."/settings.lua") | ||||||
| dofile(areas.modpath.."/api.lua") | dofile(areas.modpath.."/api.lua") | ||||||
|  |  | ||||||
|  | local async_dofile = core.register_async_dofile or dofile | ||||||
|  | async_dofile(areas.modpath.."/async.lua") | ||||||
|  |  | ||||||
| dofile(areas.modpath.."/internal.lua") | 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") | ||||||
| @@ -21,11 +25,15 @@ dofile(areas.modpath.."/hud.lua") | |||||||
|  |  | ||||||
| areas:load() | areas:load() | ||||||
|  |  | ||||||
|  | local S = minetest.get_translator("areas") | ||||||
|  |  | ||||||
| minetest.register_privilege("areas", { | minetest.register_privilege("areas", { | ||||||
| 	description = "Can administer areas." | 	description = S("Can administer areas."), | ||||||
|  | 	give_to_singleplayer = false | ||||||
| }) | }) | ||||||
| minetest.register_privilege("areas_high_limit", { | minetest.register_privilege("areas_high_limit", { | ||||||
| 	description = "Can protect more, bigger areas." | 	description = S("Can protect more, bigger areas."), | ||||||
|  | 	give_to_singleplayer = false | ||||||
| }) | }) | ||||||
| -- Mega_builder privilege -- MFF | -- Mega_builder privilege -- MFF | ||||||
| minetest.register_privilege("megabuilder", { | minetest.register_privilege("megabuilder", { | ||||||
| @@ -34,11 +42,11 @@ minetest.register_privilege("megabuilder", { | |||||||
|  |  | ||||||
| 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 = "Can protect areas.", | 		description = S("Can protect areas."), | ||||||
| 	}) | 	}) | ||||||
| end | end | ||||||
|  |  | ||||||
| if minetest.settings:get_bool("log_mods") then | if minetest.settings:get_bool("log_mods") then | ||||||
| 	local diffTime = os.clock() - areas.startTime | 	local diffTime = os.clock() - startTime | ||||||
| 	minetest.log("action", "areas loaded in "..diffTime.."s.") | 	minetest.log("action", "areas loaded in "..diffTime.."s.") | ||||||
| end | end | ||||||
|   | |||||||
							
								
								
									
										177
									
								
								internal.lua
									
									
									
									
									
								
							
							
						
						
									
										177
									
								
								internal.lua
									
									
									
									
									
								
							| @@ -4,26 +4,38 @@ function areas:player_exists(name) | |||||||
| 	return minetest.get_auth_handler().get_auth(name) ~= nil | 	return minetest.get_auth_handler().get_auth(name) ~= nil | ||||||
| end | end | ||||||
|  |  | ||||||
| local safe_file_write = minetest.safe_file_write | -- When saving is done in an async thread, the function will not be present in this global namespace. | ||||||
| if safe_file_write == nil then | if not areas._internal_do_save then | ||||||
| 	function safe_file_write(path, content) | 	local saving_requested = false | ||||||
| 		local file, err = io.open(path, "w") | 	local saving_locked = false | ||||||
| 		if err then |  | ||||||
| 			return err |  | ||||||
| 		end |  | ||||||
| 		file:write(content) |  | ||||||
| 		file:close() |  | ||||||
| 	end |  | ||||||
| end |  | ||||||
|  |  | ||||||
| -- Save the areas table to a file | 	-- Required cuz we are referring to _G.areas._internal_do_save *inside* | ||||||
| function areas:save() | 	-- async env (it does not exist in the main thread) | ||||||
| 	local datastr = minetest.serialize(self.areas) | 	local function async_func(...) | ||||||
| 	if not datastr then | 		return areas._internal_do_save(...) | ||||||
| 		minetest.log("error", "[areas] Failed to serialize area data!") | 	end | ||||||
| 		return |  | ||||||
|  | 	local function done_callback() | ||||||
|  | 		saving_locked = false | ||||||
|  | 		if saving_requested == true then | ||||||
|  | 			saving_requested = false | ||||||
|  | 			return areas:save() | ||||||
|  | 		end | ||||||
|  | 	end | ||||||
|  |  | ||||||
|  | 	function areas:save() | ||||||
|  | 		if saving_locked == true then | ||||||
|  | 			saving_requested = true | ||||||
|  | 		else | ||||||
|  | 			saving_locked = true | ||||||
|  | 			return core.handle_async(async_func, done_callback, self.areas, self.config.filename) | ||||||
|  | 		end | ||||||
|  | 	end | ||||||
|  | else | ||||||
|  | 	-- Save the areas table to a file | ||||||
|  | 	function areas:save() | ||||||
|  | 		return areas._internal_do_save(self.areas, self.config.filename) | ||||||
| 	end | 	end | ||||||
| 	return safe_file_write(self.config.filename, datastr) |  | ||||||
| end | end | ||||||
|  |  | ||||||
| -- Load the areas table from the save file | -- Load the areas table from the save file | ||||||
| @@ -33,10 +45,19 @@ function areas:load() | |||||||
| 		self.areas = self.areas or {} | 		self.areas = self.areas or {} | ||||||
| 		return err | 		return err | ||||||
| 	end | 	end | ||||||
| 	self.areas = minetest.deserialize(file:read("*a")) | 	local data = 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 | ||||||
| @@ -74,19 +95,19 @@ function areas:populateStore() | |||||||
| 	self.store_ids = store_ids | 	self.store_ids = store_ids | ||||||
| end | end | ||||||
|  |  | ||||||
| -- Finds the first usable index in a table | -- Guarentees returning an unused index in areas.areas | ||||||
| -- Eg: {[1]=false,[4]=true} -> 2 | local index_cache = 0 | ||||||
| local function findFirstUnusedIndex(t) | local function findFirstUnusedIndex() | ||||||
| 	local i = 0 | 	local t = areas.areas | ||||||
| 	repeat i = i + 1 | 	repeat index_cache = index_cache + 1 | ||||||
| 	until t[i] == nil | 	until t[index_cache] == nil | ||||||
| 	return i | 	return index_cache | ||||||
| end | end | ||||||
|  |  | ||||||
| --- Add a area. | --- Add an area. | ||||||
| -- @return The new area's ID. | -- @return The new area's ID. | ||||||
| function areas:add(owner, name, pos1, pos2, parent) | function areas:add(owner, name, pos1, pos2, parent) | ||||||
| 	local id = findFirstUnusedIndex(self.areas) | 	local id = findFirstUnusedIndex() | ||||||
| 	self.areas[id] = { | 	self.areas[id] = { | ||||||
| 		name = name, | 		name = name, | ||||||
| 		pos1 = pos1, | 		pos1 = pos1, | ||||||
| @@ -109,8 +130,8 @@ function areas:add(owner, name, pos1, pos2, parent) | |||||||
| 	return id | 	return id | ||||||
| end | end | ||||||
|  |  | ||||||
| --- Remove a area, and optionally it's children recursively. | --- Remove an area, and optionally its children recursively. | ||||||
| -- If a area is deleted non-recursively the children will | -- If an area is deleted non-recursively the children will | ||||||
| -- have the removed area's parent as their new parent. | -- have the removed area's parent as their new parent. | ||||||
| function areas:remove(id, recurse) | function areas:remove(id, recurse) | ||||||
| 	if recurse then | 	if recurse then | ||||||
| @@ -127,7 +148,6 @@ function areas:remove(id, recurse) | |||||||
| 			-- The subarea parent will be niled out if the | 			-- The subarea parent will be niled out if the | ||||||
| 			-- removed area does not have a parent | 			-- removed area does not have a parent | ||||||
| 			self.areas[cid].parent = parent | 			self.areas[cid].parent = parent | ||||||
|  |  | ||||||
| 		end | 		end | ||||||
| 	end | 	end | ||||||
|  |  | ||||||
| @@ -163,7 +183,7 @@ function areas:move(id, area, pos1, pos2) | |||||||
| 	end | 	end | ||||||
| end | end | ||||||
|  |  | ||||||
| -- Checks if a area between two points is entirely contained by another area. | -- Checks if an area between two points is entirely contained by another area. | ||||||
| -- Positions must be sorted. | -- Positions must be sorted. | ||||||
| function areas:isSubarea(pos1, pos2, id) | function areas:isSubarea(pos1, pos2, id) | ||||||
| 	local area = self.areas[id] | 	local area = self.areas[id] | ||||||
| @@ -186,7 +206,7 @@ function areas:isSubarea(pos1, pos2, id) | |||||||
| 	end | 	end | ||||||
| end | end | ||||||
|  |  | ||||||
| -- Returns a table (list) of children of an area given it's identifier | -- Returns a table (list) of children of an area given its identifier | ||||||
| function areas:getChildren(id) | function areas:getChildren(id) | ||||||
| 	local children = {} | 	local children = {} | ||||||
| 	for cid, area in pairs(self.areas) do | 	for cid, area in pairs(self.areas) do | ||||||
| @@ -197,64 +217,95 @@ function areas:getChildren(id) | |||||||
| 	return children | 	return children | ||||||
| end | end | ||||||
|  |  | ||||||
| -- Checks if the user has sufficient privileges. | -- checks all possible restrictions registered with | ||||||
| -- If the player is not a administrator it also checks | -- areas:registerProtectionCondition | ||||||
| -- if the area intersects other areas that they do not own. | -- builtin callbacks below | ||||||
| -- Also checks the size of the area and if the user already |  | ||||||
| -- has more than max_areas. |  | ||||||
| function areas:canPlayerAddArea(pos1, pos2, name) | function areas:canPlayerAddArea(pos1, pos2, name) | ||||||
|  | 	local allowed = true | ||||||
|  | 	local errMsg | ||||||
|  | 	for i=1, #areas.registered_protection_conditions do | ||||||
|  | 		local res, msg = areas.registered_protection_conditions[i](pos1, pos2, name) | ||||||
|  | 		if res == true then | ||||||
|  | 			-- always allow to protect, no matter of other conditions | ||||||
|  | 			return true | ||||||
|  | 		elseif res == false then | ||||||
|  | 			-- there might be another callback that returns true, so we can't break here | ||||||
|  | 			allowed = false | ||||||
|  | 			-- save the first error that occurred | ||||||
|  | 			errMsg = errMsg or msg | ||||||
|  | 		elseif res ~= nil then | ||||||
|  | 			local origin = areas.callback_origins[areas.registered_protection_conditions[i]] | ||||||
|  | 			error("\n[Mod] areas: Invalid api usage from mod '" .. | ||||||
|  | 					origin.mod .. "' in callback registerProtectionCondition() at " .. | ||||||
|  | 					origin.source .. ":" .. origin.line) | ||||||
|  | 		end | ||||||
|  | 	end | ||||||
|  |  | ||||||
|  | 	return allowed, errMsg | ||||||
|  | end | ||||||
|  |  | ||||||
|  | -- Checks if the user has sufficient privileges. | ||||||
|  | areas:registerProtectionCondition(function(pos1, pos2, name) | ||||||
| 	local privs = minetest.get_player_privs(name) | 	local privs = minetest.get_player_privs(name) | ||||||
| 	if privs.areas then | 	if privs.areas then | ||||||
|  | 		-- always allow administrators to create areas | ||||||
| 		return true | 		return true | ||||||
| 	end | 	end | ||||||
|  |  | ||||||
| 	-- Check self protection privilege, if it is enabled, | 	-- Check self protection privilege | ||||||
| 	-- and if the area is too big. | 	if not areas.config.self_protection or | ||||||
| 	if not self.config.self_protection or |  | ||||||
| 			not privs[areas.config.self_protection_privilege] then | 			not privs[areas.config.self_protection_privilege] then | ||||||
| 		return false, S("Self protection is disabled or you do not have" | 		return false, S("Self protection is disabled or you do not have" | ||||||
| 				.." the necessary privilege.") | 				.." the necessary privilege.") | ||||||
| 	end | 	end | ||||||
|  | end) | ||||||
|  |  | ||||||
| 	-- MFF: megabuilders skip checks on size and number of areas | -- check if the area is too big | ||||||
|  | -- NALC: megabuilders skip checks on size and number of areas | ||||||
|  | areas:registerProtectionCondition(function(pos1, pos2, name) | ||||||
|  | 	local privs = minetest.get_player_privs(name) | ||||||
| 	if not privs.megabuilder then	 | 	if not privs.megabuilder then	 | ||||||
| 		local max_size = privs.areas_high_limit and | 		local max_size = privs.areas_high_limit and | ||||||
| 			self.config.self_protection_max_size_high or | 			areas.config.self_protection_max_size_high or | ||||||
| 			self.config.self_protection_max_size | 			areas.config.self_protection_max_size | ||||||
| 		if | 		if | ||||||
| 			(pos2.x - pos1.x) > max_size.x or | 			(pos2.x - pos1.x + 1) > max_size.x or | ||||||
| 			(pos2.y - pos1.y) > max_size.y or | 			(pos2.y - pos1.y + 1) > max_size.y or | ||||||
| 			(pos2.z - pos1.z) > max_size.z then | 			(pos2.z - pos1.z + 1) > max_size.z then | ||||||
| 				return false, S("Area is too big.") | 			return false, S("Area is too big.") | ||||||
| 		end | 		end | ||||||
| 	end | 	end | ||||||
|  | end) | ||||||
|  |  | ||||||
| 		-- Check number of areas the user has and make sure it not above the max | -- Check number of areas the user has and make sure it not above the max | ||||||
| 		local count = 0 | areas:registerProtectionCondition(function(pos1, pos2, name) | ||||||
| 		for _, area in pairs(self.areas) do | 	local privs = minetest.get_player_privs(name) | ||||||
| 			if area.owner == name then | 	local count = 0 | ||||||
| 				count = count + 1 | 	for _, area in pairs(areas.areas) do | ||||||
| 			end | 		if area.owner == name then | ||||||
|  | 			count = count + 1 | ||||||
| 		end | 		end | ||||||
| 		local max_areas = privs.areas_high_limit and | 	end | ||||||
| 			self.config.self_protection_max_areas_high or | 	local max_areas = privs.areas_high_limit and | ||||||
| 			self.config.self_protection_max_areas | 			areas.config.self_protection_max_areas_high or | ||||||
|  | 			areas.config.self_protection_max_areas | ||||||
| 	if count >= max_areas then | 	if count >= max_areas then | ||||||
| 		return false, S("You have reached the maximum amount of" | 		return false, S("You have reached the maximum amount of" | ||||||
| 				.." areas that you are allowed to protect.") | 				.." areas that you are allowed to protect.") | ||||||
| 	end | 	end | ||||||
|  | end) | ||||||
|  |  | ||||||
| 	-- Check intersecting areas | -- checks if the area intersects other areas that the player do not own. | ||||||
| 	local can, id = self:canInteractInArea(pos1, pos2, name) | areas:registerProtectionCondition(function(pos1, pos2, name) | ||||||
|  | 	local can, id = areas:canInteractInArea(pos1, pos2, name) | ||||||
| 	if not can then | 	if not can then | ||||||
| 		local area = self.areas[id] | 		local area = areas.areas[id] | ||||||
| 		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 | end) | ||||||
| end |  | ||||||
|  |  | ||||||
| -- Given a id returns a string in the format: | -- Given an id returns a string in the format: | ||||||
| -- "name [id]: owner (x1, y1, z1) (x2, y2, z2) -> children" | -- "name [id]: owner (x1, y1, z1) (x2, y2, z2) -> children" | ||||||
| function areas:toString(id) | function areas:toString(id) | ||||||
| 	local area = self.areas[id] | 	local area = self.areas[id] | ||||||
|   | |||||||
							
								
								
									
										137
									
								
								locale/areas.de.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										137
									
								
								locale/areas.de.tr
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,137 @@ | |||||||
|  | # textdomain: areas | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ### chatcommands.lua ### | ||||||
|  |  | ||||||
|  | <AreaName>=<Bereichsname> | ||||||
|  | <ID> [faction_name]=<ID> [Fraktionsname] | ||||||
|  | <NewOwner>=<NeuerBesitzer> | ||||||
|  | <ParentID>=<Eltern-ID> | ||||||
|  | <PlayerName>=<Spielername> | ||||||
|  | <newName>=<neuer Name> | ||||||
|  | @1 has given you control over the area "@2" (ID @3).=@1 hat dir die Kontrolle über den Bereich „@2“ (ID @3) gegeben. | ||||||
|  | @1 spanning up to @2x@3x@4.=@1 erstreckt sich bis zu @2x@3x@4. | ||||||
|  | A regular expression is required.=Ein regulärer Ausdruck ist erforderlich. | ||||||
|  | Area @1 does not exist or is not owned by you.=Bereich @1 existiert nicht oder gehört nicht dir. | ||||||
|  | Area closed for faction members.=Bereich für Fraktionsmitglieder geschlossen. | ||||||
|  | Area closed.=Bereich geschlossen. | ||||||
|  | Area does not exist.=Bereich existiert nicht. | ||||||
|  | Area is open for members of: @1=Bereich ist offen für Mitglieder von: @1 | ||||||
|  | Area opened.=Bereich geöffnet. | ||||||
|  | Area protected. ID: @1=Bereich geschützt. ID: @1 | ||||||
|  | Area renamed.=Bereich umbenannt. | ||||||
|  | Area successfully moved.=Bereich erfolgreich verschoben. | ||||||
|  | Change the owner of an area using its ID=Ändere den Besitzer eines Bereichs anhand seiner ID. | ||||||
|  | Faction doesn't exists=Fraktion existiert nicht. | ||||||
|  | Find areas using a Lua regular expression=Suche Bereiche mithilfe eines regulären Lua-Ausdrucks. | ||||||
|  | Get information about area configuration and usage.=Erhalte Informationen zur Bereichskonfiguration und -verwendung. | ||||||
|  |  | ||||||
|  | Give a player access to a sub-area between two positions that have already been protected, Use set_owner if you don't want the parent to be set.=Gib einem Spieler Zugriff auf einen Unterbereich zwischen zwei Positionen, die bereits geschützt wurden. Benutze set_owner, wenn du nicht willst, dass der übergeordnete Bereich festgelegt wird. | ||||||
|  |  | ||||||
|  | Invalid regular expression.=Ungültiger regulärer Ausdruck. | ||||||
|  | Limit: @1 areas=Begrenzung: @1 Bereiche | ||||||
|  | Limit: no area count limit=Begrenzung: keine Bereichsanzahlbegrenzung | ||||||
|  | List your areas, or all areas if you are an admin.=Liste deine Bereiche auf, oder alle Bereiche, wenn du ein Administrator bist. | ||||||
|  | Move (or resize) an area to the current positions.=Beweg (oder skaliere) einen Bereich auf die aktuellen Positionen. | ||||||
|  | No matches found.=Keine Übereinstimmungen gefunden. | ||||||
|  | No visible areas.=Keine sichtbaren Bereiche. | ||||||
|  | Owner changed.=Besitzer geändert. | ||||||
|  | Players with the "@1" privilege can protect up to @2 areas=Spieler mit dem Privileg „@1“ können bis zu @2 Bereiche schützen | ||||||
|  |  | ||||||
|  | Protect an area between two positions and give a player access to it without setting the parent of the area to any existing area=Schütze einen Bereich zwischen zwei Positionen und gib einem Spieler Zugriff darauf, ohne den übergeordneten Bereich des Bereichs auf einen vorhandenen Bereich festzulegen | ||||||
|  |  | ||||||
|  | Protect your own area=Schütze deinen eigenen Bereich | ||||||
|  | Recursively remove areas using an ID=Entferne Bereiche rekursiv anhand einer ID | ||||||
|  | Remove an area using an ID=Entferne einen Bereich anhand seiner ID | ||||||
|  | Removed area @1=Bereich @1 entfernt | ||||||
|  | Removed area @1 and its sub areas.=Bereich @1 und seine Unterbereiche entfernt. | ||||||
|  | Removes all ownerless areas=Entfernt alle herrenlosen Bereiche | ||||||
|  | Rename an area that you own=Benenne einen Bereich um, den du besitzt | ||||||
|  | Self protection is disabled.=Selbstschutz ist deaktiviert, Spieler können keine Bereiche bestimmen. | ||||||
|  | Self protection is enabled.=Selbstschutz ist aktiviert, Spieler können selbst Bereiche bestimmen. | ||||||
|  | That area doesn't exist.=Dieser Bereich existiert nicht. | ||||||
|  | The player "@1" does not exist.=Der Spieler „@1“ existiert nicht. | ||||||
|  | Toggle an area open (anyone can interact) or closed=Schalte einen Bereich offen (jeder kann interagieren) oder geschlossen | ||||||
|  | Toggle an area open/closed for members in your faction.=Schalte einen Bereich offen/geschlossen für Mitglieder deiner Fraktion. | ||||||
|  | You are an area administrator ("areas" privilege).=Du bist ein Bereichsadministrator (Berechtigung „areas“). | ||||||
|  | You can protect areas=Du kannst Bereiche schützen. | ||||||
|  | You can't protect that area.=Du kannst diesen Bereich nicht schützen. | ||||||
|  | You can't protect that area: @1=Du kannst diesen Bereich nicht schützen: @1 | ||||||
|  | You don't have the necessary privilege ("@1").=Du hast nicht die erforderliche Berechtigung („@1“). | ||||||
|  | You don't own that area.=Du besitzt diesen Bereich nicht. | ||||||
|  | You have @1 areas.=Du hast @1 Bereiche. | ||||||
|  |  | ||||||
|  | You have been granted control over area #@1. Type /list_areas to show your areas.=Dir wurde die Kontrolle über Bereich #@1 gewährt. Gib /list_areas ein, um deine Bereiche anzuzeigen. | ||||||
|  |  | ||||||
|  | You have extended area protection limits ("areas_high_limit" privilege).=Du hast erweiterte Bereichsschutzgrenzen (Berechtigung „areas_high_limit“). | ||||||
|  |  | ||||||
|  | You have the necessary privilege ("@1").=Du hast die erforderliche Berechtigung („@1“). | ||||||
|  | You need to select an area first.=Du musst zuerst einen Bereich auswählen. | ||||||
|  |  | ||||||
|  | ### chatcommands.lua ### | ||||||
|  | ### pos.lua ### | ||||||
|  |  | ||||||
|  | <ID>=<ID> | ||||||
|  | Invalid usage, see /help @1.=Ungültige Verwendung, siehe /help @1. | ||||||
|  |  | ||||||
|  | ### hud.lua ### | ||||||
|  |  | ||||||
|  | :open=:offen | ||||||
|  | Areas:=Bereiche: | ||||||
|  |  | ||||||
|  | ### init.lua ### | ||||||
|  |  | ||||||
|  | Can administer areas.=Kann Bereiche verwalten. | ||||||
|  | Can protect areas.=Kann Bereiche schützen. | ||||||
|  | Can protect more, bigger areas.=Kann mehr, grössere Bereiche schützen. | ||||||
|  |  | ||||||
|  | ### interact.lua ### | ||||||
|  |  | ||||||
|  | @1 is protected by @2.=@1 wird durch @2 geschützt. | ||||||
|  |  | ||||||
|  | ### internal.lua ### | ||||||
|  |  | ||||||
|  | Area is too big.=Bereich ist zu gross. | ||||||
|  |  | ||||||
|  | Self protection is disabled or you do not have the necessary privilege.=Selbstschutz ist deaktiviert oder du hast nicht die erforderlichen Berechtigungen. | ||||||
|  |  | ||||||
|  | The area intersects with @1 [@2] (@3).=Der Bereich überschneidet sich mit @1 [@2] (@3). | ||||||
|  |  | ||||||
|  | You have reached the maximum amount of areas that you are allowed to protect.=Du hast die maximale Anzahl, der Bereiche, die du schützen darfst erreicht. | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ### legacy.lua ### | ||||||
|  |  | ||||||
|  | <version>=<Version> | ||||||
|  | Converted areas saved. Done.=Konvertierte Bereiche gespeichert. Fertig. | ||||||
|  | Converting areas…=Bereiche werden konvertiert… | ||||||
|  | Error loading legacy file: @1=Fehler beim Laden der Vorgänger-Datei: @1 | ||||||
|  | Invalid version number. (0 allowed)=Ungültige Versionsnummer. (Erlaubt: 0) | ||||||
|  | Legacy file loaded.=Vorgänger-Datei geladen. | ||||||
|  |  | ||||||
|  | Loads, converts, and saves the areas from a legacy save file.=Lädt, konvertiert und speichert die Bereiche aus einer Vorgänger-Speicherdatei. | ||||||
|  |  | ||||||
|  | Table format updated.=Tabellenformat aktualisiert. | ||||||
|  | unnamed=unbenannt | ||||||
|  |  | ||||||
|  | ### pos.lua ### | ||||||
|  |  | ||||||
|  | <not set>=<nicht festgelegt> | ||||||
|  | Area @1 selected.=Bereich @1 ausgewählt. | ||||||
|  | Area position @1 set to @2=Bereichsposition @1 auf @2 festgelegt | ||||||
|  | Position @1 set to @2=Position @1 auf @2 festgelegt | ||||||
|  | Position @1:=Position @1: | ||||||
|  | Select an area by ID.=Wähle einen Bereich anhand seiner ID. | ||||||
|  | Select position @1 by punching a node.=Wähle Position @1, durch schlagen eines Knoten. | ||||||
|  | Select positions by punching two nodes.=Wähle Positionen, durch schlagen zweier Knoten. | ||||||
|  |  | ||||||
|  | Set area protection region position @1 to your location or the one specified=Setzt die Bereichsschutzregion-Position @1 auf deinen Standort oder den angegebenen. | ||||||
|  |  | ||||||
|  | Set area protection region, position 1, or position 2 by punching nodes, or display the region=Setzt die Bereichsschutzregion, Position 1 oder Position 2 fest, durch schlagen von Knoten, oder zeigt die Region an. | ||||||
|  |  | ||||||
|  | The area @1 does not exist.=Der Bereich @1 existiert nicht. | ||||||
|  | Unable to get position.=Position konnte nicht ermittelt werden. | ||||||
|  | Unknown subcommand: @1=Unbekannter Unterbefehl: @1 | ||||||
|  |  | ||||||
|  | Relative coordinates is not supported on this server. Please upgrade Minetest to 5.7.0 or newer versions.=Relative Koordinaten werden auf diesem Server nicht unterstützt. Bitte aktualisiere Minetest auf Version 5.7.0 oder neuer. | ||||||
							
								
								
									
										137
									
								
								locale/areas.es.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										137
									
								
								locale/areas.es.tr
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,137 @@ | |||||||
|  | # textdomain: areas | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ### chatcommands.lua ### | ||||||
|  |  | ||||||
|  | <AreaName>=<nombre del área> | ||||||
|  | <ID> [faction_name]=<ID> [nombre_de_facción] | ||||||
|  | <NewOwner>=<nuevo_propietario> | ||||||
|  | <ParentID>=<ID_de_padre> | ||||||
|  | <PlayerName>=<nombre_del_jugador> | ||||||
|  | <newName>=<nuevo nombre> | ||||||
|  | @1 has given you control over the area "@2" (ID @3).=@1 te ha dado control sobre el área "@2" (ID @3). | ||||||
|  | @1 spanning up to @2x@3x@4.=@1 abarca hasta @2x@3x@4. | ||||||
|  | A regular expression is required.=Se requiere una expresión regular. | ||||||
|  | Area @1 does not exist or is not owned by you.=El área @1 no existe o no es de tu propiedad. | ||||||
|  | Area closed for faction members.=Área cerrada para miembros de la facción. | ||||||
|  | Area closed.=Área cerrada. | ||||||
|  | Area does not exist.=El área no existe. | ||||||
|  | Area is open for members of: @1=El área está abierta para miembros de: @1 | ||||||
|  | Area opened.=Área abierta. | ||||||
|  | Area protected. ID: @1=Área protegida. ID: @1 | ||||||
|  | Area renamed.=Área renombrada. | ||||||
|  | Area successfully moved.=Área movida exitosamente. | ||||||
|  | Change the owner of an area using its ID=Cambia el propietario de un área usando su ID | ||||||
|  | Faction doesn't exists=La facción no existe | ||||||
|  | Find areas using a Lua regular expression=Encuentra áreas usando una expresión regular de Lua | ||||||
|  | Get information about area configuration and usage.=Obtén información sobre la configuración y el uso del área. | ||||||
|  |  | ||||||
|  | Give a player access to a sub-area between two positions that have already been protected, Use set_owner if you don't want the parent to be set.=Otorgue a un jugador acceso a una área secundaria entre dos posiciones que ya han sido protegidas. Usa set_owner si no deseas que se configure la área principal como padre. | ||||||
|  |  | ||||||
|  | Invalid regular expression.=Expresión regular no válida. | ||||||
|  | Limit: @1 areas=Límite: @1 áreas | ||||||
|  | Limit: no area count limit=Límite: sin límite de recuento de áreas | ||||||
|  | List your areas, or all areas if you are an admin.=Enumere tus áreas o todas las áreas si eres administrador. | ||||||
|  | Move (or resize) an area to the current positions.=Mueve (o redimensiona) una área a las posiciones actuales. | ||||||
|  | No matches found.=No se encontraron coincidencias. | ||||||
|  | No visible areas.=No hay áreas visibles. | ||||||
|  | Owner changed.=Se cambió el propietario. | ||||||
|  | Players with the "@1" privilege can protect up to @2 areas=Los jugadores con el privilegio "@1" pueden proteger hasta @2 áreas | ||||||
|  |  | ||||||
|  | Protect an area between two positions and give a player access to it without setting the parent of the area to any existing area=Proteje una área entre dos posiciones y otorgue acceso a un jugador sin configurarle una área como padre | ||||||
|  |  | ||||||
|  | Protect your own area=Proteje tu propia área | ||||||
|  | Recursively remove areas using an ID=Elimina áreas recursivamente usando una ID | ||||||
|  | Remove an area using an ID=Elimina una área usando una ID | ||||||
|  | Removed area @1=Área @1 eliminada | ||||||
|  | Removed area @1 and its sub areas.=Área @1 y sus subáreas eliminadas. | ||||||
|  | Removes all ownerless areas=Elimina todas las áreas sin propietario | ||||||
|  | Rename an area that you own=Cambia el nombre de una áreas que es de tu propiedad | ||||||
|  | Self protection is disabled.=La protección por sí mismo está deshabilitada. | ||||||
|  | Self protection is enabled.=La protección por sí mismo está habilitada. | ||||||
|  | That area doesn't exist.=Esa área no existe. | ||||||
|  | The player "@1" does not exist.=El jugador "@1" no existe. | ||||||
|  | Toggle an area open (anyone can interact) or closed=Activa o desactiva la apertura o el cierre de una área para todos los jugadores | ||||||
|  | Toggle an area open/closed for members in your faction.=Activa o desactiva la apertura o el cierre de una área para los miembros de tu facción. | ||||||
|  | You are an area administrator ("areas" privilege).=Eres un administrador de área (privilegio "areas"). | ||||||
|  | You can protect areas=Puedes proteger áreas | ||||||
|  | You can't protect that area.=No puedes proteger esa área. | ||||||
|  | You can't protect that area: @1=No puedes proteger esa área: @1 | ||||||
|  | You don't have the necessary privilege ("@1").=No tienes el privilegio necesario ("@1"). | ||||||
|  | You don't own that area.=No eres el propietario de esa área. | ||||||
|  | You have @1 areas.=Te pertenecen @1 áreas. | ||||||
|  |  | ||||||
|  | You have been granted control over area #@1. Type /list_areas to show your areas.=Se te ha otorgado el control sobre el área #@1. Escribe /list_areas para mostrar tus áreas. | ||||||
|  |  | ||||||
|  | You have extended area protection limits ("areas_high_limit" privilege).=Tienes límites de protección de área extendidos (privilegio "areas_high_limit"). | ||||||
|  |  | ||||||
|  | You have the necessary privilege ("@1").=Tienes el privilegio necesario ("@1"). | ||||||
|  | You need to select an area first.=Primero debes seleccionar una área. | ||||||
|  |  | ||||||
|  | ### chatcommands.lua ### | ||||||
|  | ### pos.lua ### | ||||||
|  |  | ||||||
|  | <ID>=<ID> | ||||||
|  | Invalid usage, see /help @1.=Uso no válido, consulta /help @1. | ||||||
|  |  | ||||||
|  | ### hud.lua ### | ||||||
|  |  | ||||||
|  | :open=:abierta | ||||||
|  | Areas:=Áreas: | ||||||
|  |  | ||||||
|  | ### init.lua ### | ||||||
|  |  | ||||||
|  | Can administer areas.=Puede administrar áreas. | ||||||
|  | Can protect areas.=Puede proteger áreas. | ||||||
|  | Can protect more, bigger areas.=Puede proteger más áreas, más grandes. | ||||||
|  |  | ||||||
|  | ### interact.lua ### | ||||||
|  |  | ||||||
|  | @1 is protected by @2.=@1 está protegido por @2. | ||||||
|  |  | ||||||
|  | ### internal.lua ### | ||||||
|  |  | ||||||
|  | Area is too big.=El área es demasiado grande. | ||||||
|  |  | ||||||
|  | Self protection is disabled or you do not have the necessary privilege.=La protección por sí mismo está deshabilitada o no tienes el privilegio necesario. | ||||||
|  |  | ||||||
|  | The area intersects with @1 [@2] (@3).=El área se interseca con @1 [@2] (@3). | ||||||
|  |  | ||||||
|  | You have reached the maximum amount of areas that you are allowed to protect.=Has alcanzado la cantidad máxima de áreas que tienes permitido proteger. | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ### legacy.lua ### | ||||||
|  |  | ||||||
|  | <version>=<versión> | ||||||
|  | Converted areas saved. Done.=Áreas convertidas guardadas. Listo. | ||||||
|  | Converting areas…=Convirtiendo áreas… | ||||||
|  | Error loading legacy file: @1=Error al cargar archivo heredado: @1 | ||||||
|  | Invalid version number. (0 allowed)=Número de versión no válido. (Solo se permite: 0) | ||||||
|  | Legacy file loaded.=Archivo heredado cargado. | ||||||
|  |  | ||||||
|  | Loads, converts, and saves the areas from a legacy save file.=Carga, convierte y guarda las áreas desde un archivo guardado heredado. | ||||||
|  |  | ||||||
|  | Table format updated.=Formato de tabla actualizado. | ||||||
|  | unnamed=sin nombre | ||||||
|  |  | ||||||
|  | ### pos.lua ### | ||||||
|  |  | ||||||
|  | <not set>=<no establecida> | ||||||
|  | Area @1 selected.=Área @1 seleccionada. | ||||||
|  | Area position @1 set to @2=Posición del área @1 establecida en @2 | ||||||
|  | Position @1 set to @2=Posición @1 establecida en @2 | ||||||
|  | Position @1:=Posición @1: | ||||||
|  | Select an area by ID.=Selecciona una área por ID. | ||||||
|  | Select position @1 by punching a node.=Selecciona la posición @1 golpeando un nodo. | ||||||
|  | Select positions by punching two nodes.=Selecciona las posiciones golpeando dos nodos. | ||||||
|  |  | ||||||
|  | Set area protection region position @1 to your location or the one specified=Establece la posición de la región de protección del área @1 en tu ubicación o en la especificada | ||||||
|  |  | ||||||
|  | Set area protection region, position 1, or position 2 by punching nodes, or display the region=Establece la región de protección del área, la posición 1 o la posición 2 golpeando nodos, o muestre la región | ||||||
|  |  | ||||||
|  | The area @1 does not exist.=El área @1 no existe. | ||||||
|  | Unable to get position.=No se puede obtener la posición. | ||||||
|  | Unknown subcommand: @1=Subcomando desconocido: @1 | ||||||
|  |  | ||||||
|  | Relative coordinates is not supported on this server. Please upgrade Minetest to 5.7.0 or newer versions.=Las coordenadas relativas no son compatibles con este servidor. Actualiza Minetest a 5.7.0 o versiones más nuevas. | ||||||
| @@ -1,81 +1,91 @@ | |||||||
| # textdomain: areas | # textdomain: areas | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| ### chatcommands.lua ### | ### chatcommands.lua ### | ||||||
|  |  | ||||||
| <AreaName>=<NomZone> | <AreaName>=<nom de la zone> | ||||||
|  | <ID> [faction_name]=<ID> [nom_de_faction] | ||||||
| <NewOwner>=<NouveauPropriétaire> | <NewOwner>=<NouveauPropriétaire> | ||||||
| <ParentID>=<IDZonePrincipale> | <ParentID>=<IDZonePrincipale> | ||||||
| <PlayerName>=<NomJoueur> | <PlayerName>=<NomJoueur> | ||||||
| <newName>=<NouveauNom> | <newName>=<nouveau nom> | ||||||
| @1 has given you control over the area "@2" (ID @3).=@1 vous a donné le contrôle de la zone "@2" (ID @3). | @1 has given you control over the area "@2" (ID @3).=@1 t'a donné le contrôle de la zone "@2" (ID @3). | ||||||
| @1 spanning up to @2x@3x@4.=@1 s’étendant jusqu’à @2x@3x@4. | @1 spanning up to @2x@3x@4.=@1 s’étendant jusqu’à @2x@3x@4. | ||||||
| A regular expression is required.=Une expression régulière est requise. | A regular expression is required.=Une expression régulière est requise. | ||||||
| Area @1 does not exist or is not owned by you.=La zone @1 n’existe pas ou ne vous appartient pas. | Area @1 does not exist or is not owned by you.=La zone @1 n’existe pas ou ne t'appartient pas. | ||||||
| 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 n’existe pas. | Area does not exist.=La zone n’existe pas. | ||||||
| Area opened for faction members.=Zone ouverte aux membres de la faction. | Area is open for members of: @1=Zone ouverte aux membres de ces factions : @1 | ||||||
| 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 d’une zone en utilisant son ID. | Change the owner of an area using its ID=Changer le propriétaire d’une zone en utilisant son ID. | ||||||
| Find areas using a Lua regular expression=Trouve les zones en utilisant une expression régulière Lua. | Faction doesn't exists=La faction n'existe pas | ||||||
| Get information about area configuration and usage.=Obtient des informations sur la configuration des zones et l’utilisation des zones. | Find areas using a Lua regular expression=Trouver les zones en utilisant une expression régulière Lua. | ||||||
|  | Get information about area configuration and usage.=Obtenir des informations sur la configuration des zones et l’utilisation des zones. | ||||||
|  |  | ||||||
| Give a player access to a sub-area beetween two positions that have already been protected, Use set_owner if you don't want the parent to be set.=Donne au joueur accès aux sous-zones entre deux positions qui ont déjà été protégées ; utilisez set_owner si vous ne voulez pas que la zone pricipale soit définie. | Give a player access to a sub-area between two positions that have already been protected, Use set_owner if you don't want the parent to be set.=Donne au joueur accès aux sous-zones entre deux positions qui ont déjà été protégées ; utilisez set_owner si tu ne veux pas que le parent soit définie. | ||||||
|  |  | ||||||
| Invalid regular expression.=Expression régulière invalide. | Invalid regular expression.=Expression régulière invalide. | ||||||
| Limit: @1 areas=Limite: @1 zones. | Limit: @1 areas=Limite: @1 zones. | ||||||
| Limit: no area count limit=Limite: pas de limite de nombre de zones. | Limit: no area count limit=Limite: pas de limite de nombre de zones. | ||||||
| List your areas, or all areas if you are an admin.=Liste vos zones, ou toutes les zones si vous êtes administrateur. | List your areas, or all areas if you are an admin.=Liste tes zones, ou toutes les zones si tu es administrateur. | ||||||
| Move (or resize) an area to the current positions.=Déplace (ou redimensionne) une zone aux positions actuelles. | Move (or resize) an area to the current positions.=Déplace (ou redimensionne) une zone aux positions actuelles. | ||||||
| No matches found.=Aucun résultat. | No matches found.=Aucun résultat. | ||||||
| No visible areas.=Pas de zone visible. | No visible areas.=Pas de zone visible. | ||||||
| Owner changed.=Propriétaire changé. | Owner changed.=Propriétaire changé. | ||||||
| Players with the "@1" privilege can protect up to @2 areas=Les joueurs avec le privilège "@1" peuvent protéger jusqu’à @2 zones | Players with the "@1" privilege can protect up to @2 areas=Les joueurs avec le privilège "@1" peuvent protéger jusqu’à @2 zones | ||||||
|  |  | ||||||
| Protect an area between two positions and give a player access to it without setting the parent of the area to any existing area=Protège une zone entre deux positions et donne à un joueur accès à cette zone sans définir la zone principale de cette zone ni aucune zone existante. | Protect an area between two positions and give a player access to it without setting the parent of the area to any existing area=Protège une zone entre deux positions et donne à un joueur accès à cette zone sans définir la zone principale (parent) de cette zone ni aucune zone existante. | ||||||
|  |  | ||||||
| Protect your own area=Protège votre zone. | Protect your own area=Protège ta propre zone. | ||||||
| Recursively remove areas using an ID=Supprime les zones récursivement en utilisant un ID. | Recursively remove areas using an ID=Supprime les zones récursivement en utilisant un ID. | ||||||
| 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 its sub areas.=Zone @1 et ses sous-zones supprimées. | ||||||
| Rename an area that you own=Renomme une zone qui vous appartient. | Removes all ownerless areas=Supprime toutes les zones sans propriétaire | ||||||
|  | Rename an area that you own=Renomme une zone que tu possèdes. | ||||||
| Self protection is disabled.=L’autoprotection est désactivée. | Self protection is disabled.=L’autoprotection est désactivée. | ||||||
| Self protection is enabled.=L’autoprotection est activée. | Self protection is enabled.=L’autoprotection est activée. | ||||||
| That area doesn't exist.=La zone n’existe pas. | That area doesn't exist.=La zone n’existe pas. | ||||||
| The player "@1" does not exist.=Le joueur "@1" n’existe pas. | The player "@1" does not exist.=Le joueur "@1" n’existe pas. | ||||||
| Toggle an area open (anyone can interact) or closed=Bascule entre zone ouverte (tout le monde peut intéragir) ou fermée. | Toggle an area open (anyone can interact) or closed=Bascule entre zone ouverte (tout le monde peut intéragir) ou fermée. | ||||||
| Toggle an area open/closed for members in your faction.=Bascule entre zone ouverte/fermée pour les membres de votre faction. | Toggle an area open/closed for members in your faction.=Bascule entre zone ouverte/fermée pour les membres de ta faction. | ||||||
| You are an area administrator ("areas" privilege).=Vous êtes un administrateur de zone (privilège "areas"). | You are an area administrator ("areas" privilege).=Tu es un administrateur de zone (privilège "areas"). | ||||||
| You can protect areas=Vous pouvez protéger des zones. | You can protect areas=Tu peux protéger des zones. | ||||||
| You can't protect that area.=Vous ne pouvez pas protéger cette zone. | You can't protect that area.=Tu ne peux pas protéger cette zone. | ||||||
| You can't protect that area: @1=Vous ne pouvez pas protéger cette zone : @1. | You can't protect that area: @1=Tu ne peux pas protéger cette zone : @1. | ||||||
| You don't have the necessary privilege ("@1").=Vous n’avez pas le privilège nécessaire ("@1"). | You don't have the necessary privilege ("@1").=Tu n'as pas le privilège nécessaire ("@1"). | ||||||
| You don't own that area.=Vous ne possédez pas cette zone. | You don't own that area.=Tu n'es pas propriétaire de cette zone. | ||||||
| You have @1 areas.=Vous avez @1 zones. | You have @1 areas.=Tu as @1 zones. | ||||||
|  |  | ||||||
| You have been granted control over area #@1. Type /list_areas to show your areas.=Vous avez reçu l’autorisation de contrôler la zone #@1. | You have been granted control over area #@1. Type /list_areas to show your areas.=Tu as reçu l’autorisation de contrôler la zone #@1. | ||||||
|  |  | ||||||
| You have extended area protection limits ("areas_high_limit" privilege).=Votre limite de protection de zones est étendue (privilège "areas_high_limit"). | You have extended area protection limits ("areas_high_limit" privilege).=Tu limite de protection de zones est étendue (privilège "areas_high_limit"). | ||||||
|  |  | ||||||
| You have the necessary privilege ("@1").=Vous avez le privilège nécessaire ("@1"). | You have the necessary privilege ("@1").=Tu as le privilège nécessaire ("@1"). | ||||||
| You need to select an area first.=Vous devez sélectionner une zone d’abord. | You need to select an area first.=Tu dois d'abord sélectionner une zone. | ||||||
|  |  | ||||||
| ### chatcommands.lua ### | ### chatcommands.lua ### | ||||||
| ### pos.lua ### | ### pos.lua ### | ||||||
|  |  | ||||||
| <ID>=<ID> | <ID>=<ID> | ||||||
| Invalid usage, see /help @1.=Utilisation incorrecte, voir /help @1. | Invalid usage, see /help @1.=Utilisation non valid, voir /help @1. | ||||||
|  |  | ||||||
| ### hud.lua ### | ### hud.lua ### | ||||||
|  |  | ||||||
| :open= : ouverte | :open= : ouverte | ||||||
| Areas:=Zones : | Areas:=Zones : | ||||||
|  |  | ||||||
|  | ### init.lua ### | ||||||
|  |  | ||||||
|  | Can administer areas.=Permet d’administrer 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. | ||||||
| @@ -84,11 +94,11 @@ Areas:=Zones : | |||||||
|  |  | ||||||
| Area is too big.=La zone est trop grande. | Area is too big.=La zone est trop grande. | ||||||
|  |  | ||||||
| Self protection is disabled or you do not have the necessary privilege.=L’autoprotection est désactivée ou vous n’avez pas le privilège nécessaire. | Self protection is disabled or you do not have the necessary privilege.=L’autoprotection est désactivée ou tu n’as pas le privilège nécessaire. | ||||||
|  |  | ||||||
| The area intersects with @1 [@2] (@3).=La zone a une intersection avec @1 [@2] (@3). | The area intersects with @1 [@2] (@3).=La zone a une intersection avec @1 [@2] (@3). | ||||||
|  |  | ||||||
| You have reached the maximum amount of areas that you are allowed to protect.=Vous avez atteint le nombre maximum de zones que vous êtes autorisé à protéger. | You have reached the maximum amount of areas that you are allowed to protect.=Tu as atteint le nombre maximum de zones que tu es autorisé à protéger. | ||||||
|  |  | ||||||
|  |  | ||||||
| ### legacy.lua ### | ### legacy.lua ### | ||||||
| @@ -103,7 +113,7 @@ Legacy file loaded.=Fichier obsolète chargé. | |||||||
| Loads, converts, and saves the areas from a legacy save file.=Charge, fait la conversion et sauvegarde les zones depuis un fichier de sauvegarde obsolète. | Loads, converts, and saves the areas from a legacy save file.=Charge, fait la conversion et sauvegarde les zones depuis un fichier de sauvegarde obsolète. | ||||||
|  |  | ||||||
| Table format updated.=Format de tableau mis à jour. | Table format updated.=Format de tableau mis à jour. | ||||||
| unnamed=Non nommé | unnamed=non nommé | ||||||
|  |  | ||||||
| ### pos.lua ### | ### pos.lua ### | ||||||
|  |  | ||||||
| @@ -111,15 +121,17 @@ unnamed=Non nommé | |||||||
| Area @1 selected.=Zone @1 sélectionnée. | Area @1 selected.=Zone @1 sélectionnée. | ||||||
| Area position @1 set to @2=Position @1 de la zone définie à @2. | Area position @1 set to @2=Position @1 de la zone définie à @2. | ||||||
| Position @1 set to @2=Position @1 définie à @2. | Position @1 set to @2=Position @1 définie à @2. | ||||||
| Position @1: =Position @1 : | Position @1:=Position @1 : | ||||||
| Select an area by ID.=Sélectionnez une zone par son ID. | Select an area by ID.=Sélectionne une zone par son ID. | ||||||
| Select position @1 by punching a node.=Sélectionnez une position en frappant un bloc. | Select position @1 by punching a node.=Sélectionne une position @1 en frappant un bloc. | ||||||
| Select positions by punching two nodes.=Sélectionnez une position en frappant deux blocs. | Select positions by punching two nodes.=Sélectionne une position en frappant deux blocs. | ||||||
|  |  | ||||||
| Set area protection region position @1 to your location or the one specified=Définit la position @1 de la région de protection de zone à votre position ou à celle spécifiée. | Set area protection region position @1 to your location or the one specified=Définit la position @1 de la région de protection de zone à tu position ou à celle spécifiée. | ||||||
|  |  | ||||||
| Set area protection region, position 1, or position 2 by punching nodes, or display the region=Définit la région de protection de zone, la position 1, ou la position 2 en frappant des blocs, ou en affichant la région. | Set area protection region, position 1, or position 2 by punching nodes, or display the region=Définit la région de protection de zone, la position 1, ou la position 2 en frappant des blocs, ou en affichant la région. | ||||||
|  |  | ||||||
| The area @1 does not exist.=La zone @1 n’existe pas. | The area @1 does not exist.=La zone @1 n’existe pas. | ||||||
| Unable to get position.=Impossible d’obtenir la position. | Unable to get position.=Impossible d’obtenir la position. | ||||||
| Unknown subcommand: @1=Sous-commande inconnue : @1 | Unknown subcommand: @1=Sous-commande inconnue : @1 | ||||||
|  |  | ||||||
|  | Relative coordinates is not supported on this server. Please upgrade Minetest to 5.7.0 or newer versions.=Les coordonnées relatives ne sont pas prises en charge sur ce serveur. Mets à niveau Minetest vers la version 5.7.0 ou une version plus récente. | ||||||
|   | |||||||
| @@ -1,9 +1,11 @@ | |||||||
| # 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> | ||||||
| @@ -15,16 +17,17 @@ 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 opened for faction members.=Area aperta per i membri della fazione. | Area is open for members of: @1=L'area è aperta ai membri di: @1 | ||||||
| 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. | ||||||
|  |  | ||||||
| Give a player access to a sub-area beetween two positions that have already been protected, Use set_owner if you don't want the parent to be set.=Dai a un giocatore l'accesso a una sotto-area tra due posizioni che sono già state protette, usa set_owner se non vuoi che sia impostato il parent. | Give a player access to a sub-area between two positions that have already been protected, Use set_owner if you don't want the parent to be set.=Dai a un giocatore l'accesso a una sotto-area tra due posizioni che sono già state protette, usa set_owner se non vuoi che sia impostato il parent. | ||||||
|  |  | ||||||
| Invalid regular expression.=Espressione regolare non valida. | Invalid regular expression.=Espressione regolare non valida. | ||||||
| Limit: @1 areas=Limite: @1 aree | Limit: @1 areas=Limite: @1 aree | ||||||
| @@ -42,7 +45,8 @@ Protect your own area=Proteggi la tua area | |||||||
| Recursively remove areas using an ID=Elimina ricorsivamente delle aree usando un ID | Recursively remove areas using an ID=Elimina ricorsivamente delle aree usando un ID | ||||||
| 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 its 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. | ||||||
| @@ -76,6 +80,12 @@ 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. | ||||||
| @@ -111,7 +121,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. | ||||||
| @@ -123,3 +133,5 @@ Set area protection region, position 1, or position 2 by punching nodes, or disp | |||||||
| The area @1 does not exist.=L'area @1 non esiste. | The area @1 does not exist.=L'area @1 non esiste. | ||||||
| Unable to get position.=Impossibile ottenere la posizione. | Unable to get position.=Impossibile ottenere la posizione. | ||||||
| Unknown subcommand: @1=Sotto-comando sconosciuto: @1 | Unknown subcommand: @1=Sotto-comando sconosciuto: @1 | ||||||
|  |  | ||||||
|  | Relative coordinates is not supported on this server. Please upgrade Minetest to 5.7.0 or newer versions.= | ||||||
|   | |||||||
							
								
								
									
										137
									
								
								locale/areas.ru.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										137
									
								
								locale/areas.ru.tr
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,137 @@ | |||||||
|  | # textdomain: areas | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ### chatcommands.lua ### | ||||||
|  |  | ||||||
|  | <AreaName>=<имя_территории> | ||||||
|  | <ID> [faction_name]=<ID> [имя_фракции] | ||||||
|  | <NewOwner>=<новый_владелец> | ||||||
|  | <ParentID>=<ID_родительской> | ||||||
|  | <PlayerName>=<имя_игрока> | ||||||
|  | <newName>=<новое_имя> | ||||||
|  | @1 has given you control over the area "@2" (ID @3).=@1 передал вам территорию "@2" (ID @3). | ||||||
|  | @1 spanning up to @2x@3x@4.=@1 размером до @2x@3x@4. | ||||||
|  | A regular expression is required.=Не указано регулярное выражение. | ||||||
|  | Area @1 does not exist or is not owned by you.=Территория @1 не существует или Вы не имеете к ней доступа. | ||||||
|  | Area closed for faction members.=Территория закрыта для игроков из фракций. | ||||||
|  | Area closed.=Территория закрыта. | ||||||
|  | Area does not exist.=Территория не существует. | ||||||
|  | Area is open for members of: @1=Территория открыта для игроков из фракций: @1 | ||||||
|  | Area opened.=Территория открыта. | ||||||
|  | Area protected. ID: @1=Территория защищена. ID: @1 | ||||||
|  | Area renamed.=Территория переименована. | ||||||
|  | Area successfully moved.=Территория успешно перенесена. | ||||||
|  | Change the owner of an area using its ID=Изменить владельца территории по её ID | ||||||
|  | Faction doesn't exists=Фракция не существует. | ||||||
|  | Find areas using a Lua regular expression=Поиск территорий с использованием регулярных выражений Lua | ||||||
|  | Get information about area configuration and usage.=Получить информацию о конфигурации и использовании защиты территорий. | ||||||
|  |  | ||||||
|  | Give a player access to a sub-area between two positions that have already been protected, Use set_owner if you don't want the parent to be set.=Дать игроку доступ к выделенной территории, создав дополнительный регион. Используйте set_owner, если вы не хотите привязки к родительской территории. | ||||||
|  |  | ||||||
|  | Invalid regular expression.=Неверное регулярное выражение. | ||||||
|  | Limit: @1 areas=Ограничение: @1 территорий(я) | ||||||
|  | Limit: no area count limit=Ограничение: нет ограничений на кол-во территорий | ||||||
|  | List your areas, or all areas if you are an admin.=Вывести список доступных Вам территорий или всех существующих территорий, если вы администратор. | ||||||
|  | Move (or resize) an area to the current positions.=Переместить (или изменить размер) территории. | ||||||
|  | No matches found.=Совпадений не найдено. | ||||||
|  | No visible areas.=Нет доступных территорий. | ||||||
|  | Owner changed.=Владелец изменён. | ||||||
|  | Players with the "@1" privilege can protect up to @2 areas=Игроки, имеющие привилегию "@1" могут защищать до @2 территорий | ||||||
|  |  | ||||||
|  | Protect an area between two positions and give a player access to it without setting the parent of the area to any existing area=Защитить территорию между двумя позициями и дать игроку доступ к ней без привязки к родительскому региону. | ||||||
|  |  | ||||||
|  | Protect your own area=Защитить вашу территорию | ||||||
|  | Recursively remove areas using an ID=Рекурсивное удаление территорий (вместе с дочерними) по его ID | ||||||
|  | Remove an area using an ID=Удаление территории по его ID | ||||||
|  | Removed area @1=Удалена территория @1 | ||||||
|  | Removed area @1 and its sub areas.=Удалена территория @1 и её дочерние территории. | ||||||
|  | Removes all ownerless areas=Удалить все бесхозные территории (без владельца) | ||||||
|  | Rename an area that you own=Переименовать территорию, которой вы владеете. | ||||||
|  | Self protection is disabled.=Защита своих территорий отключена. | ||||||
|  | Self protection is enabled.=Защита своих территорий включена. | ||||||
|  | That area doesn't exist.=Территория не существует. | ||||||
|  | The player "@1" does not exist.=Игрок "@1" не существует. | ||||||
|  | Toggle an area open (anyone can interact) or closed=Открыть/закрыть территорию для других игроков | ||||||
|  | Toggle an area open/closed for members in your faction.=Открыть/закрыть территорию для игроков вашей фракции. | ||||||
|  | You are an area administrator ("areas" privilege).=Вы можете управлять всеми территориями (привилегия "areas") | ||||||
|  | You can protect areas=Вы можете защищать территории | ||||||
|  | You can't protect that area.=Вы не можете установить защиту на эту территорию. | ||||||
|  | You can't protect that area: @1=Вы не можете установить защиту на территорию: @1 | ||||||
|  | You don't have the necessary privilege ("@1").=У Вас нет необходимой привилегии ("@1"). | ||||||
|  | You don't own that area.=Вы не являетесь владельцем этой территории. | ||||||
|  | You have @1 areas.=У вас @1 территорий. | ||||||
|  |  | ||||||
|  | You have been granted control over area #@1. Type /list_areas to show your areas.=Вам выдан доступ к территории #@1. | ||||||
|  |  | ||||||
|  | You have extended area protection limits ("areas_high_limit" privilege).=У вас увеличенный лимит на кол-во создаваемых вами защищённых территорий | ||||||
|  |  | ||||||
|  | You have the necessary privilege ("@1").=У вас есть необходимая привилегия ("@1"). | ||||||
|  | You need to select an area first.=Сначала необходимо выделить территорию. | ||||||
|  |  | ||||||
|  | ### chatcommands.lua ### | ||||||
|  | ### pos.lua ### | ||||||
|  |  | ||||||
|  | <ID>= | ||||||
|  | Invalid usage, see /help @1.=Неверное использование, см. /help @1. | ||||||
|  |  | ||||||
|  | ### hud.lua ### | ||||||
|  |  | ||||||
|  | :open=:открытая | ||||||
|  | Areas:=Территории: | ||||||
|  |  | ||||||
|  | ### init.lua ### | ||||||
|  |  | ||||||
|  | Can administer areas.=Может управлять территориями. | ||||||
|  | Can protect areas.=Может создавать защищённые территории. | ||||||
|  | Can protect more, bigger areas.=Может создавать защищённые территории больше территорий и с бОльшим размером. | ||||||
|  |  | ||||||
|  | ### interact.lua ### | ||||||
|  |  | ||||||
|  | @1 is protected by @2.=@1 - принадлежит @2. | ||||||
|  |  | ||||||
|  | ### internal.lua ### | ||||||
|  |  | ||||||
|  | Area is too big.=Территория слишком велика. | ||||||
|  |  | ||||||
|  | Self protection is disabled or you do not have the necessary privilege.=Возможность защиты территорий отключена или же Вы не имеете необходимых привилегий. | ||||||
|  |  | ||||||
|  | The area intersects with @1 [@2] (@3).=Территория пересекается с @1 [@2] (@3). | ||||||
|  |  | ||||||
|  | You have reached the maximum amount of areas that you are allowed to protect.=Вы достигли максимально допустимого количества на создание защищённых территорий. | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ### legacy.lua ### | ||||||
|  |  | ||||||
|  | <version>=<версия> | ||||||
|  | Converted areas saved. Done.=Готово. Сконвертированные территории сохранены. | ||||||
|  | Converting areas…=Конвертирование территорий… | ||||||
|  | Error loading legacy file: @1=Ошибка загрузки файла с устаревшим форматом: @1 | ||||||
|  | Invalid version number. (0 allowed)=Неверный номер версии. (поддерживается 0) | ||||||
|  | Legacy file loaded.=Файл с устаревшим форматом загружен. | ||||||
|  |  | ||||||
|  | Loads, converts, and saves the areas from a legacy save file.=Загружает, конвертирует и сохраняет территории из файла с устаревшим форматом. | ||||||
|  |  | ||||||
|  | Table format updated.=Формат обновлён. | ||||||
|  | unnamed=без_названия | ||||||
|  |  | ||||||
|  | ### pos.lua ### | ||||||
|  |  | ||||||
|  | <not set>=<не_установлена> | ||||||
|  | Area @1 selected.=Территория @1 выбрана. | ||||||
|  | Area position @1 set to @2=Позиция @1 установлена в @2 | ||||||
|  | Position @1 set to @2=Позиция @1 установлена в @2 | ||||||
|  | Position @1:=Позиция @1: | ||||||
|  | Select an area by ID.=Выбрать территорию по её ID. | ||||||
|  | Select position @1 by punching a node.=Установите позицию @1, ударив по блоку. | ||||||
|  | Select positions by punching two nodes.=Установите позиции, ударив по двум блокам. | ||||||
|  |  | ||||||
|  | Set area protection region position @1 to your location or the one specified=Установить позицию @1 для выбора защищаемой территории | ||||||
|  |  | ||||||
|  | Set area protection region, position 1, or position 2 by punching nodes, or display the region=Установить позиции 1 и/или 2, ударяя по блокам, или вывести ранее установленные позиции | ||||||
|  |  | ||||||
|  | The area @1 does not exist.=Территория @1 не существует. | ||||||
|  | Unable to get position.=Не удалось получить позицию. | ||||||
|  | Unknown subcommand: @1=Неизвестная под-команда/аргумент. | ||||||
|  |  | ||||||
|  | Relative coordinates is not supported on this server. Please upgrade Minetest to 5.7.0 or newer versions.= | ||||||
							
								
								
									
										137
									
								
								locale/areas.zh_CN.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										137
									
								
								locale/areas.zh_CN.tr
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,137 @@ | |||||||
|  | # textdomain: areas | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ### chatcommands.lua ### | ||||||
|  |  | ||||||
|  | <AreaName>=<保护区名称> | ||||||
|  | <ID> [faction_name]=<保护区编号> [派系名称] | ||||||
|  | <NewOwner>=<新拥有者> | ||||||
|  | <ParentID>=<上级保护区编号> | ||||||
|  | <PlayerName>=<玩家名称> | ||||||
|  | <newName>=<新名称> | ||||||
|  | @1 has given you control over the area "@2" (ID @3).=@1 已将保护区“@2”(编号 @3)的控制权交与您。 | ||||||
|  | @1 spanning up to @2x@3x@4.=@1,最大为 @2x@3x@4。 | ||||||
|  | A regular expression is required.=需要正则表达式。 | ||||||
|  | Area @1 does not exist or is not owned by you.=保护区 @1 不存在,或并非由您拥有。 | ||||||
|  | Area closed for faction members.=保护区已对派系成员关闭。 | ||||||
|  | Area closed.=保护区已关闭。 | ||||||
|  | Area does not exist.=保护区不存在。 | ||||||
|  | Area is open for members of: @1=保护区已对以下派系的成员开放:@1 | ||||||
|  | Area opened.=保护区已开放。 | ||||||
|  | Area protected. ID: @1=成功进行保护。 保护区编号:@1 | ||||||
|  | Area renamed.=保护区已重新命名。 | ||||||
|  | Area successfully moved.=成功移动保护区。 | ||||||
|  | Change the owner of an area using its ID=通过保护区编号改变其拥有者 | ||||||
|  | Faction doesn't exists=派系不存在 | ||||||
|  | Find areas using a Lua regular expression=使用 Lua 正则表达式寻找保护区 | ||||||
|  | Get information about area configuration and usage.=获得保护区配置与使用的资讯。 | ||||||
|  |  | ||||||
|  | Give a player access to a sub-area between two positions that have already been protected, Use set_owner if you don't want the parent to be set.=授予其他玩家已有保护区内一部分地方、两个座标之间区域的的存取权。如果不想上级保护区被设定,请使用 /set_owner。 | ||||||
|  |  | ||||||
|  | Invalid regular expression.=正则表达式无效。 | ||||||
|  | Limit: @1 areas=限制:@1个保护区 | ||||||
|  | Limit: no area count limit=限制:无数量限制 | ||||||
|  | List your areas, or all areas if you are an admin.=列出您拥有的保护区,或对于管理员而言,列出所有保护区。 | ||||||
|  | Move (or resize) an area to the current positions.=移动一保护区至目前座标,或改变其大小。 | ||||||
|  | No matches found.=找不到匹配项。 | ||||||
|  | No visible areas.=没有保护区可供查阅。 | ||||||
|  | Owner changed.=拥有者已修改。 | ||||||
|  | Players with the "@1" privilege can protect up to @2 areas=拥有“@1”权限的玩家最多可以保护 @2 个保护区 | ||||||
|  |  | ||||||
|  | Protect an area between two positions and give a player access to it without setting the parent of the area to any existing area=授予其他玩家两个座标之间区域的控制权,而不设定上级保护区 | ||||||
|  |  | ||||||
|  | Protect your own area=对您自己的地区施加保护 | ||||||
|  | Recursively remove areas using an ID=通过保护区编号移除保护区以及其所有子保护区 | ||||||
|  | Remove an area using an ID=通过保护区编号移除一保护区 | ||||||
|  | Removed area @1=保护区 @1 已移除 | ||||||
|  | Removed area @1 and its sub areas.=保护区 @1 以及其所有子保护区已移除。 | ||||||
|  | Removes all ownerless areas=移除所有无主保护区 | ||||||
|  | Rename an area that you own=重新命名您拥有的保护区 | ||||||
|  | Self protection is disabled.=自我保护被禁用。 | ||||||
|  | Self protection is enabled.=自我保护被启用。 | ||||||
|  | That area doesn't exist.=保护区不存在。 | ||||||
|  | The player "@1" does not exist.=玩家“@1”不存在。 | ||||||
|  | Toggle an area open (anyone can interact) or closed=切换保护区开放状态(如开放,所有玩家均可互动) | ||||||
|  | Toggle an area open/closed for members in your faction.=切换保护区对派系成员的开放状态 | ||||||
|  | You are an area administrator ("areas" privilege).=您是保护区管理员(拥有“area”权限) | ||||||
|  | You can protect areas=您可以建立保护区 | ||||||
|  | You can't protect that area.=您无法保护该区域。 | ||||||
|  | You can't protect that area: @1=您无法保护该区域:@1 | ||||||
|  | You don't have the necessary privilege ("@1").=您没有所需权限(“@1”) | ||||||
|  | You don't own that area.=您并不拥有该保护区。 | ||||||
|  | You have @1 areas.=您有 @1 个保护区。 | ||||||
|  |  | ||||||
|  | You have been granted control over area #@1. Type /list_areas to show your areas.=您已被授予保护区 #@1 的控制权。 使用 /list_areas 以查看您的保护区。 | ||||||
|  |  | ||||||
|  | You have extended area protection limits ("areas_high_limit" privilege).=您拥有延伸保护权限(拥有“areas_high_limit”权限) | ||||||
|  |  | ||||||
|  | You have the necessary privilege ("@1").=您拥有所需权限(“@1”) | ||||||
|  | You need to select an area first.=请先选择范围。 | ||||||
|  |  | ||||||
|  | ### chatcommands.lua ### | ||||||
|  | ### pos.lua ### | ||||||
|  |  | ||||||
|  | <ID>=<保护区编号> | ||||||
|  | Invalid usage, see /help @1.=无效用法,请参见 /help @1。 | ||||||
|  |  | ||||||
|  | ### hud.lua ### | ||||||
|  |  | ||||||
|  | :open=:开放 | ||||||
|  | Areas:=保护区: | ||||||
|  |  | ||||||
|  | ### init.lua ### | ||||||
|  |  | ||||||
|  | Can administer areas.=可以管理保护区 | ||||||
|  | Can protect areas.=可以进行保护 | ||||||
|  | Can protect more, bigger areas.=进行保护时,数量以及体积上限提高。 | ||||||
|  |  | ||||||
|  | ### interact.lua ### | ||||||
|  |  | ||||||
|  | @1 is protected by @2.=@1 被 @2 保护。 | ||||||
|  |  | ||||||
|  | ### internal.lua ### | ||||||
|  |  | ||||||
|  | Area is too big.=区域过大。 | ||||||
|  |  | ||||||
|  | Self protection is disabled or you do not have the necessary privilege.=自我保护被禁用,或您没有所需权限。 | ||||||
|  |  | ||||||
|  | The area intersects with @1 [@2] (@3).=区域与 @1 [@2] (@3) 重叠。 | ||||||
|  |  | ||||||
|  | You have reached the maximum amount of areas that you are allowed to protect.=您的现有保护区数量已达到所允许的上限。 | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ### legacy.lua ### | ||||||
|  |  | ||||||
|  | <version>=<版本> | ||||||
|  | Converted areas saved. Done.=转换后的保护区已经保存。 完成。 | ||||||
|  | Converting areas…=正在转换保护区…… | ||||||
|  | Error loading legacy file: @1=载入旧档案时发生错误:@1 | ||||||
|  | Invalid version number. (0 allowed)=无效版本号。(允许值:0) | ||||||
|  | Legacy file loaded.=旧档案已载入。 | ||||||
|  |  | ||||||
|  | Loads, converts, and saves the areas from a legacy save file.=载入、转换并储存旧存档中的保护区。 | ||||||
|  |  | ||||||
|  | Table format updated.=表格格式已更新。 | ||||||
|  | unnamed=未命名 | ||||||
|  |  | ||||||
|  | ### pos.lua ### | ||||||
|  |  | ||||||
|  | <not set>=<未设定> | ||||||
|  | Area @1 selected.=保护区 @1 已选择。 | ||||||
|  | Area position @1 set to @2=保护区座标 @1 已设定为 @2。 | ||||||
|  | Position @1 set to @2=保护区座标 @1 已设定为 @2。 | ||||||
|  | Position @1:=保护区座标 @1: | ||||||
|  | Select an area by ID.=通过保护区编号选择区域 | ||||||
|  | Select position @1 by punching a node.=请击打方块以设定保护区座标 @1 的位置。 | ||||||
|  | Select positions by punching two nodes.=请击打两个方块,以设定保护区座标的位置。 | ||||||
|  |  | ||||||
|  | Set area protection region position @1 to your location or the one specified=将保护区座标 @1 的位置设定为您目前的位置或提供的座标 | ||||||
|  |  | ||||||
|  | Set area protection region, position 1, or position 2 by punching nodes, or display the region=击打方块设定保护区座标,或获得其座标资讯 | ||||||
|  |  | ||||||
|  | The area @1 does not exist.=保护区 @1 不存在。 | ||||||
|  | Unable to get position.=无法获得座标。 | ||||||
|  | Unknown subcommand: @1=子指令不明:@1 | ||||||
|  |  | ||||||
|  | Relative coordinates is not supported on this server. Please upgrade Minetest to 5.7.0 or newer versions.=此服务器不支援相对座标。请更新Minetest至5.7.0或之后的版本。 | ||||||
							
								
								
									
										137
									
								
								locale/areas.zh_TW.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										137
									
								
								locale/areas.zh_TW.tr
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,137 @@ | |||||||
|  | # textdomain: areas | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ### chatcommands.lua ### | ||||||
|  |  | ||||||
|  | <AreaName>=<保護區名稱> | ||||||
|  | <ID> [faction_name]=<保護區編號> [派系名稱] | ||||||
|  | <NewOwner>=<新擁有者> | ||||||
|  | <ParentID>=<上級保護區編號> | ||||||
|  | <PlayerName>=<玩家名稱> | ||||||
|  | <newName>=<新名稱> | ||||||
|  | @1 has given you control over the area "@2" (ID @3).=@1 已將保護區「@2」(編號 @3)的控制權交與您。 | ||||||
|  | @1 spanning up to @2x@3x@4.=@1,最大爲 @2x@3x@4。 | ||||||
|  | A regular expression is required.=需要正則表達式。 | ||||||
|  | Area @1 does not exist or is not owned by you.=保護區 @1 不存在,或並非由您擁有。 | ||||||
|  | Area closed for faction members.=保護區已對派系成員關閉。 | ||||||
|  | Area closed.=保護區已關閉。 | ||||||
|  | Area does not exist.=保護區不存在。 | ||||||
|  | Area is open for members of: @1=保護區已對以下派系的成員開放:@1 | ||||||
|  | Area opened.=保護區已開放。 | ||||||
|  | Area protected. ID: @1=成功進行保護。保護區編號:@1 | ||||||
|  | Area renamed.=保護區已重新命名。 | ||||||
|  | Area successfully moved.=成功移動保護區。 | ||||||
|  | Change the owner of an area using its ID=通過保護區編號改變其擁有者 | ||||||
|  | Faction doesn't exists=派系不存在 | ||||||
|  | Find areas using a Lua regular expression=使用 Lua 正則表達式尋找保護區 | ||||||
|  | Get information about area configuration and usage.=獲得保護區配置與使用的資訊。 | ||||||
|  |  | ||||||
|  | Give a player access to a sub-area between two positions that have already been protected, Use set_owner if you don't want the parent to be set.=授予其他玩家已有保護區內一部分地方、兩個座標之間區域的的存取權。如果不想上級保護區被設定,請使用 /set_owner。 | ||||||
|  |  | ||||||
|  | Invalid regular expression.=正則表達式無效。 | ||||||
|  | Limit: @1 areas=限制:@1個保護區 | ||||||
|  | Limit: no area count limit=限制:無數量限制 | ||||||
|  | List your areas, or all areas if you are an admin.=列出您擁有的保護區,或對於管理員而言,列出所有保護區。 | ||||||
|  | Move (or resize) an area to the current positions.=移動一保護區至目前座標,或改變其大小。 | ||||||
|  | No matches found.=找不到匹配項。 | ||||||
|  | No visible areas.=沒有保護區可供查閱。 | ||||||
|  | Owner changed.=擁有者已修改。 | ||||||
|  | Players with the "@1" privilege can protect up to @2 areas=擁有「@1」權限的玩家最多可以保護 @2 個保護區 | ||||||
|  |  | ||||||
|  | Protect an area between two positions and give a player access to it without setting the parent of the area to any existing area=授予其他玩家兩個座標之間區域的控制權,而不設定上級保護區 | ||||||
|  |  | ||||||
|  | Protect your own area=對您自己的地區施加保護 | ||||||
|  | Recursively remove areas using an ID=通過保護區編號移除保護區以及其所有子保護區 | ||||||
|  | Remove an area using an ID=通過保護區編號移除一保護區 | ||||||
|  | Removed area @1=保護區 @1 已移除 | ||||||
|  | Removed area @1 and its sub areas.=保護區 @1 以及其所有子保護區已移除 | ||||||
|  | Removes all ownerless areas=移除所有無主保護區 | ||||||
|  | Rename an area that you own=重新命名您擁有的保護區 | ||||||
|  | Self protection is disabled.=自我保護被禁用。 | ||||||
|  | Self protection is enabled.=自我保護被啓用。 | ||||||
|  | That area doesn't exist.=保護區不存在。 | ||||||
|  | The player "@1" does not exist.=玩家「@1」不存在。 | ||||||
|  | Toggle an area open (anyone can interact) or closed=切換保護區開放狀態(如開放,所有玩家均可互動) | ||||||
|  | Toggle an area open/closed for members in your faction.=切換保護區對派系成員的開放狀態 | ||||||
|  | You are an area administrator ("areas" privilege).=您是保護區管理員(擁有「area」權限) | ||||||
|  | You can protect areas=您可以建立保護區 | ||||||
|  | You can't protect that area.=您無法保護該區域。 | ||||||
|  | You can't protect that area: @1=您無法保護該區域:@1 | ||||||
|  | You don't have the necessary privilege ("@1").=您沒有所需權限(「@1」) | ||||||
|  | You don't own that area.=您並不擁有改保護區。 | ||||||
|  | You have @1 areas.=您有 @1 個保護區。 | ||||||
|  |  | ||||||
|  | You have been granted control over area #@1. Type /list_areas to show your areas.=您已被授予保護區 #@1 的控制權。使用 /list_areas 以查看您的保護區。 | ||||||
|  |  | ||||||
|  | You have extended area protection limits ("areas_high_limit" privilege).=您擁有延伸保護權限(擁有「areas_high_limit」權限) | ||||||
|  |  | ||||||
|  | You have the necessary privilege ("@1").=您擁有所需權限(「@1」) | ||||||
|  | You need to select an area first.=請先選擇範圍。 | ||||||
|  |  | ||||||
|  | ### chatcommands.lua ### | ||||||
|  | ### pos.lua ### | ||||||
|  |  | ||||||
|  | <ID>=<保護區編號> | ||||||
|  | Invalid usage, see /help @1.=無效用法,請參見 /help @1。 | ||||||
|  |  | ||||||
|  | ### hud.lua ### | ||||||
|  |  | ||||||
|  | :open=:開放 | ||||||
|  | Areas:=保護區: | ||||||
|  |  | ||||||
|  | ### init.lua ### | ||||||
|  |  | ||||||
|  | Can administer areas.=可以管理保護區 | ||||||
|  | Can protect areas.=可以進行保護 | ||||||
|  | Can protect more, bigger areas.=進行保護時,數量以及體積上限提高。 | ||||||
|  |  | ||||||
|  | ### interact.lua ### | ||||||
|  |  | ||||||
|  | @1 is protected by @2.=@1 被 @2 保護。 | ||||||
|  |  | ||||||
|  | ### internal.lua ### | ||||||
|  |  | ||||||
|  | Area is too big.=區域過大。 | ||||||
|  |  | ||||||
|  | Self protection is disabled or you do not have the necessary privilege.=自我保護被禁用,或您沒有所需權限。 | ||||||
|  |  | ||||||
|  | The area intersects with @1 [@2] (@3).=區域與 @1 [@2] (@3) 重疊。 | ||||||
|  |  | ||||||
|  | You have reached the maximum amount of areas that you are allowed to protect.=您的現有保護區數量已達到所允許的上限。 | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ### legacy.lua ### | ||||||
|  |  | ||||||
|  | <version>=<版本> | ||||||
|  | Converted areas saved. Done.=轉換後的保護區已經保存。完成。 | ||||||
|  | Converting areas…=正在轉換保護區…… | ||||||
|  | Error loading legacy file: @1=載入舊檔案時發生錯誤:@1 | ||||||
|  | Invalid version number. (0 allowed)=無效版本號。(允許值:0) | ||||||
|  | Legacy file loaded.=舊檔案已載入。 | ||||||
|  |  | ||||||
|  | Loads, converts, and saves the areas from a legacy save file.=載入、轉換並儲存舊存檔中的保護區。 | ||||||
|  |  | ||||||
|  | Table format updated.=表格格式已更新。 | ||||||
|  | unnamed=未命名 | ||||||
|  |  | ||||||
|  | ### pos.lua ### | ||||||
|  |  | ||||||
|  | <not set>=<未設定> | ||||||
|  | Area @1 selected.=保護區 @1 已選擇。 | ||||||
|  | Area position @1 set to @2=保護區座標 @1 已設定爲 @2。 | ||||||
|  | Position @1 set to @2=保護區座標 @1 已設定爲 @2。 | ||||||
|  | Position @1:=保護區座標 @1: | ||||||
|  | Select an area by ID.=通過保護區編號選擇區域 | ||||||
|  | Select position @1 by punching a node.=請擊打方塊,以設定保護區座標 @1 的位置。 | ||||||
|  | Select positions by punching two nodes.=請擊打兩個方塊,以設定保護區座標的位置。 | ||||||
|  |  | ||||||
|  | Set area protection region position @1 to your location or the one specified=將保護區座標 @1 的位置設定爲您目前的位置或提供的座標 | ||||||
|  |  | ||||||
|  | Set area protection region, position 1, or position 2 by punching nodes, or display the region=擊打方塊設定保護區座標,或獲得其座標資訊 | ||||||
|  |  | ||||||
|  | The area @1 does not exist.=保護區 @1 不存在。 | ||||||
|  | Unable to get position.=無法獲得座標。 | ||||||
|  | Unknown subcommand: @1=子指令不明:@1 | ||||||
|  |  | ||||||
|  | Relative coordinates is not supported on this server. Please upgrade Minetest to 5.7.0 or newer versions.=此伺服器不支援相對座標。請更新Minetest至5.7.0或之後的版本。 | ||||||
| @@ -1,9 +1,11 @@ | |||||||
| # textdomain: areas | # textdomain: areas | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| ### chatcommands.lua ### | ### chatcommands.lua ### | ||||||
|  |  | ||||||
| <AreaName>= | <AreaName>= | ||||||
|  | <ID> [faction_name]= | ||||||
| <NewOwner>= | <NewOwner>= | ||||||
| <ParentID>= | <ParentID>= | ||||||
| <PlayerName>= | <PlayerName>= | ||||||
| @@ -15,16 +17,17 @@ 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 opened for faction members.= | Area is open for members of: @1= | ||||||
| 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.= | ||||||
|  |  | ||||||
| Give a player access to a sub-area beetween two positions that have already been protected, Use set_owner if you don't want the parent to be set.= | Give a player access to a sub-area between two positions that have already been protected, Use set_owner if you don't want the parent to be set.= | ||||||
|  |  | ||||||
| Invalid regular expression.= | Invalid regular expression.= | ||||||
| Limit: @1 areas= | Limit: @1 areas= | ||||||
| @@ -42,7 +45,8 @@ Protect your own area= | |||||||
| Recursively remove areas using an ID= | 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 its 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.= | ||||||
| @@ -65,8 +69,6 @@ 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 ### | ||||||
|  |  | ||||||
| @@ -78,6 +80,12 @@ 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.= | ||||||
| @@ -113,7 +121,7 @@ unnamed= | |||||||
| Area @1 selected.= | Area @1 selected.= | ||||||
| Area position @1 set to @2= | Area position @1 set to @2= | ||||||
| Position @1 set to @2= | Position @1 set to @2= | ||||||
| Position @1: = | Position @1:= | ||||||
| Select an area by ID.= | Select an area by ID.= | ||||||
| Select position @1 by punching a node.= | Select position @1 by punching a node.= | ||||||
| Select positions by punching two nodes.= | Select positions by punching two nodes.= | ||||||
| @@ -125,3 +133,5 @@ Set area protection region, position 1, or position 2 by punching nodes, or disp | |||||||
| The area @1 does not exist.= | The area @1 does not exist.= | ||||||
| Unable to get position.= | Unable to get position.= | ||||||
| Unknown subcommand: @1= | Unknown subcommand: @1= | ||||||
|  |  | ||||||
|  | Relative coordinates is not supported on this server. Please upgrade Minetest to 5.7.0 or newer versions.= | ||||||
|   | |||||||
							
								
								
									
										215
									
								
								pos.lua
									
									
									
									
									
								
							
							
						
						
									
										215
									
								
								pos.lua
									
									
									
									
									
								
							| @@ -4,10 +4,8 @@ local S = minetest.get_translator("areas") | |||||||
| -- permission to use those commands and you don't have | -- permission to use those commands and you don't have | ||||||
| -- /area_pos{1,2} [X Y Z|X,Y,Z]. | -- /area_pos{1,2} [X Y Z|X,Y,Z]. | ||||||
| -- Since this is mostly copied from WorldEdit it is mostly | -- Since this is mostly copied from WorldEdit it is mostly | ||||||
| -- licensed under the AGPL. (select_area is a exception) | -- licensed under the AGPL. (select_area is an exception) | ||||||
|  |  | ||||||
| areas.marker1 = {} |  | ||||||
| areas.marker2 = {} |  | ||||||
| areas.set_pos = {} | areas.set_pos = {} | ||||||
| areas.pos1 = {} | areas.pos1 = {} | ||||||
| areas.pos2 = {} | areas.pos2 = {} | ||||||
| @@ -22,6 +20,37 @@ local function posLimit(pos) | |||||||
| 	} | 	} | ||||||
| end | end | ||||||
|  |  | ||||||
|  | local parse_relative_pos | ||||||
|  |  | ||||||
|  | if minetest.parse_relative_number then | ||||||
|  | 	parse_relative_pos = function(x_str, y_str, z_str, pos) | ||||||
|  |  | ||||||
|  | 		local x = pos and minetest.parse_relative_number(x_str, pos.x) | ||||||
|  | 			or tonumber(x_str) | ||||||
|  | 		local y = pos and minetest.parse_relative_number(y_str, pos.y) | ||||||
|  | 			or tonumber(y_str) | ||||||
|  | 		local z = pos and minetest.parse_relative_number(z_str, pos.z) | ||||||
|  | 			or tonumber(z_str) | ||||||
|  | 		if x and y and z then | ||||||
|  | 			return vector.new(x, y, z) | ||||||
|  | 		end | ||||||
|  | 	end | ||||||
|  | else | ||||||
|  | 	parse_relative_pos = function(x_str, y_str, z_str, pos) | ||||||
|  | 		local x = tonumber(x_str) | ||||||
|  | 		local y = tonumber(y_str) | ||||||
|  | 		local z = tonumber(z_str) | ||||||
|  | 		if x and y and z then | ||||||
|  | 			return vector.new(x, y, z) | ||||||
|  | 		elseif string.sub(x_str, 1, 1) == "~" | ||||||
|  | 			or string.sub(y_str, 1, 1) == "~" | ||||||
|  | 			or string.sub(z_str, 1, 1) == "~" then | ||||||
|  | 			return nil, S("Relative coordinates is not supported on this server. " .. | ||||||
|  | 				"Please upgrade Minetest to 5.7.0 or newer versions.") | ||||||
|  | 		end | ||||||
|  | 	end | ||||||
|  | end | ||||||
|  |  | ||||||
| minetest.register_chatcommand("select_area", { | minetest.register_chatcommand("select_area", { | ||||||
| 	params = S("<ID>"), | 	params = S("<ID>"), | ||||||
| 	description = S("Select an area by ID."), | 	description = S("Select an area by ID."), | ||||||
| @@ -47,20 +76,25 @@ minetest.register_chatcommand("area_pos1", { | |||||||
| 	privs = {}, | 	privs = {}, | ||||||
| 	func = function(name, param) | 	func = function(name, param) | ||||||
| 		local pos | 		local pos | ||||||
| 		local found, _, x, y, z = param:find( | 		local player = minetest.get_player_by_name(name) | ||||||
| 				"^(-?%d+)[, ](-?%d+)[, ](-?%d+)$") | 		if player then | ||||||
|  | 			pos = vector.round(player:get_pos()) | ||||||
|  | 		end | ||||||
|  | 		local found, _, x_str, y_str, z_str = param:find( | ||||||
|  | 			"^(~?-?%d*)[, ](~?-?%d*)[, ](~?-?%d*)$") | ||||||
| 		if found then | 		if found then | ||||||
| 			pos = {x=tonumber(x), y=tonumber(y), z=tonumber(z)} | 			local get_pos, reason = parse_relative_pos(x_str, y_str, z_str, pos) | ||||||
| 		elseif param == "" then | 			if get_pos then | ||||||
| 			local player = minetest.get_player_by_name(name) | 				pos = get_pos | ||||||
| 			if player then | 			elseif not get_pos and reason then | ||||||
| 				pos = player:get_pos() | 				return false, reason | ||||||
| 			else |  | ||||||
| 				return false, S("Unable to get position.") |  | ||||||
| 			end | 			end | ||||||
| 		else | 		elseif param ~= "" then | ||||||
| 			return false, S("Invalid usage, see /help @1.", "area_pos1") | 			return false, S("Invalid usage, see /help @1.", "area_pos1") | ||||||
| 		end | 		end | ||||||
|  | 		if not pos then | ||||||
|  | 			return false, S("Unable to get position.") | ||||||
|  | 		end | ||||||
| 		pos = posLimit(vector.round(pos)) | 		pos = posLimit(vector.round(pos)) | ||||||
| 		areas:setPos1(name, pos) | 		areas:setPos1(name, pos) | ||||||
| 		return true, S("Area position @1 set to @2", "1", | 		return true, S("Area position @1 set to @2", "1", | ||||||
| @@ -74,20 +108,25 @@ minetest.register_chatcommand("area_pos2", { | |||||||
| 		.." location or the one specified", "2"), | 		.." location or the one specified", "2"), | ||||||
| 	func = function(name, param) | 	func = function(name, param) | ||||||
| 		local pos | 		local pos | ||||||
| 		local found, _, x, y, z = param:find( | 		local player = minetest.get_player_by_name(name) | ||||||
| 				"^(-?%d+)[, ](-?%d+)[, ](-?%d+)$") | 		if player then | ||||||
|  | 			pos = vector.round(player:get_pos()) | ||||||
|  | 		end | ||||||
|  | 		local found, _, x_str, y_str, z_str = param:find( | ||||||
|  | 			"^(~?-?%d*)[, ](~?-?%d*)[, ](~?-?%d*)$") | ||||||
| 		if found then | 		if found then | ||||||
| 			pos = {x=tonumber(x), y=tonumber(y), z=tonumber(z)} | 			local get_pos, reason = parse_relative_pos(x_str, y_str, z_str, pos) | ||||||
| 		elseif param == "" then | 			if get_pos then | ||||||
| 			local player = minetest.get_player_by_name(name) | 				pos = get_pos | ||||||
| 			if player then | 			elseif not get_pos and reason then | ||||||
| 				pos = player:get_pos() | 				return false, reason | ||||||
| 			else |  | ||||||
| 				return false, S("Unable to get position.") |  | ||||||
| 			end | 			end | ||||||
| 		else | 		elseif param ~= "" then | ||||||
| 			return false, S("Invalid usage, see /help @1.", "area_pos2") | 			return false, S("Invalid usage, see /help @1.", "area_pos2") | ||||||
| 		end | 		end | ||||||
|  | 		if not pos then | ||||||
|  | 			return false, S("Unable to get position.") | ||||||
|  | 		end | ||||||
| 		pos = posLimit(vector.round(pos)) | 		pos = posLimit(vector.round(pos)) | ||||||
| 		areas:setPos2(name, pos) | 		areas:setPos2(name, pos) | ||||||
| 		return true, S("Area position @1 set to @2", "2", | 		return true, S("Area position @1 set to @2", "2", | ||||||
| @@ -111,7 +150,7 @@ minetest.register_chatcommand("area_pos", { | |||||||
| 			areas.set_pos[name] = "pos2" | 			areas.set_pos[name] = "pos2" | ||||||
| 			return true, S("Select position @1 by punching a node.", "2") | 			return true, S("Select position @1 by punching a node.", "2") | ||||||
| 		elseif param == "get" then -- Display current area positions | 		elseif param == "get" then -- Display current area positions | ||||||
| 			local pos1str, pos2str = S("Position @1: ", "1"), S("Position @1: ", "2") | 			local pos1str, pos2str = S("Position @1:", " 1"), S("Position @1:", " 2") | ||||||
| 			if areas.pos1[name] then | 			if areas.pos1[name] then | ||||||
| 				pos1str = pos1str..minetest.pos_to_string(areas.pos1[name]) | 				pos1str = pos1str..minetest.pos_to_string(areas.pos1[name]) | ||||||
| 			else | 			else | ||||||
| @@ -140,42 +179,70 @@ function areas:getPos(playerName) | |||||||
| 	return areas:sortPos(pos1, pos2) | 	return areas:sortPos(pos1, pos2) | ||||||
| end | end | ||||||
|  |  | ||||||
| function areas:setPos1(playerName, pos) | function areas:setPos1(name, pos) | ||||||
| 	areas.pos1[playerName] = posLimit(pos) | 	local old_pos = areas.pos1[name] | ||||||
| 	areas.markPos1(playerName) | 	pos = posLimit(pos) | ||||||
|  | 	areas.pos1[name] = pos | ||||||
|  |  | ||||||
|  | 	if old_pos then | ||||||
|  | 		-- TODO: use `core.objects_inside_radius` after Luanti 5.10.0 is well established. | ||||||
|  | 		for _, object in ipairs(core.get_objects_inside_radius(old_pos, 0.01)) do | ||||||
|  | 			local luaentity = object:get_luaentity() | ||||||
|  | 			if luaentity and luaentity.name == "areas:pos1" and luaentity.player == name then | ||||||
|  | 				object:remove() | ||||||
|  | 			end | ||||||
|  | 		end | ||||||
|  | 	end | ||||||
|  |  | ||||||
|  | 	local entity = core.add_entity(pos, "areas:pos1") | ||||||
|  | 	if entity then | ||||||
|  | 		local luaentity = entity:get_luaentity() | ||||||
|  | 		if luaentity then | ||||||
|  | 			luaentity.player = name | ||||||
|  | 		end | ||||||
|  | 	end | ||||||
| end | end | ||||||
|  |  | ||||||
| function areas:setPos2(playerName, pos) | function areas:setPos2(name, pos) | ||||||
| 	areas.pos2[playerName] = posLimit(pos) | 	local old_pos = areas.pos2[name] | ||||||
| 	areas.markPos2(playerName) | 	pos = posLimit(pos) | ||||||
| end | 	areas.pos2[name] = pos | ||||||
|  |  | ||||||
|  | 	if old_pos then | ||||||
|  | 		-- TODO: use `core.objects_inside_radius` after Luanti 5.10.0 is well established. | ||||||
|  | 		for _, object in ipairs(core.get_objects_inside_radius(old_pos, 0.01)) do | ||||||
|  | 			local luaentity = object:get_luaentity() | ||||||
|  | 			if luaentity and luaentity.name == "areas:pos2" and luaentity.player == name then | ||||||
|  | 				object:remove() | ||||||
|  | 			end | ||||||
|  | 		end | ||||||
|  | 	end | ||||||
|  |  | ||||||
|  | 	local entity = core.add_entity(pos, "areas:pos2") | ||||||
|  | 	if entity then | ||||||
|  | 		local luaentity = entity:get_luaentity() | ||||||
|  | 		if luaentity then | ||||||
|  | 			luaentity.player = name | ||||||
|  | 		end | ||||||
|  | 	end | ||||||
|  | end | ||||||
|  |  | ||||||
| minetest.register_on_punchnode(function(pos, node, puncher) | minetest.register_on_punchnode(function(pos, node, puncher) | ||||||
| 	local name = puncher:get_player_name() | 	local name = puncher:get_player_name() | ||||||
| 	-- Currently setting position | 	-- Currently setting position | ||||||
| 	if name ~= "" and areas.set_pos[name] then | 	if name ~= "" and areas.set_pos[name] then | ||||||
| 		if areas.set_pos[name] == "pos1" then | 		if areas.set_pos[name] == "pos2" then | ||||||
| 			areas.pos1[name] = pos | 			areas:setPos2(name, pos) | ||||||
| 			areas.markPos1(name) |  | ||||||
| 			areas.set_pos[name] = "pos2" |  | ||||||
| 			minetest.chat_send_player(name, |  | ||||||
| 					S("Position @1 set to @2", "1", |  | ||||||
| 					minetest.pos_to_string(pos))) |  | ||||||
| 		elseif areas.set_pos[name] == "pos1only" then |  | ||||||
| 			areas.pos1[name] = pos |  | ||||||
| 			areas.markPos1(name) |  | ||||||
| 			areas.set_pos[name] = nil |  | ||||||
| 			minetest.chat_send_player(name, |  | ||||||
| 					S("Position @1 set to @2", "1", |  | ||||||
| 					minetest.pos_to_string(pos))) |  | ||||||
| 		elseif areas.set_pos[name] == "pos2" then |  | ||||||
| 			areas.pos2[name] = pos |  | ||||||
| 			areas.markPos2(name) |  | ||||||
| 			areas.set_pos[name] = nil | 			areas.set_pos[name] = nil | ||||||
| 			minetest.chat_send_player(name, | 			minetest.chat_send_player(name, | ||||||
| 					S("Position @1 set to @2", "2", | 					S("Position @1 set to @2", "2", | ||||||
| 					minetest.pos_to_string(pos))) | 					minetest.pos_to_string(pos))) | ||||||
|  | 		else | ||||||
|  | 			areas:setPos1(name, pos) | ||||||
|  | 			areas.set_pos[name] = areas.set_pos[name] == "pos1" and "pos2" or nil | ||||||
|  | 			minetest.chat_send_player(name, | ||||||
|  | 					S("Position @1 set to @2", "1", | ||||||
|  | 					minetest.pos_to_string(pos))) | ||||||
| 		end | 		end | ||||||
| 	end | 	end | ||||||
| end) | end) | ||||||
| @@ -196,32 +263,6 @@ function areas:sortPos(pos1, pos2) | |||||||
| 	return pos1, pos2 | 	return pos1, pos2 | ||||||
| end | end | ||||||
|  |  | ||||||
| -- Marks area position 1 |  | ||||||
| areas.markPos1 = function(name) |  | ||||||
| 	local pos = areas.pos1[name] |  | ||||||
| 	if areas.marker1[name] ~= nil then -- Marker already exists |  | ||||||
| 		areas.marker1[name]:remove() -- Remove marker |  | ||||||
| 		areas.marker1[name] = nil |  | ||||||
| 	end |  | ||||||
| 	if pos ~= nil then -- Add marker |  | ||||||
| 		areas.marker1[name] = minetest.add_entity(pos, "areas:pos1") |  | ||||||
| 		areas.marker1[name]:get_luaentity().active = true |  | ||||||
| 	end |  | ||||||
| end |  | ||||||
|  |  | ||||||
| -- Marks area position 2 |  | ||||||
| areas.markPos2 = function(name) |  | ||||||
| 	local pos = areas.pos2[name] |  | ||||||
| 	if areas.marker2[name] ~= nil then -- Marker already exists |  | ||||||
| 		areas.marker2[name]:remove() -- Remove marker |  | ||||||
| 		areas.marker2[name] = nil |  | ||||||
| 	end |  | ||||||
| 	if pos ~= nil then -- Add marker |  | ||||||
| 		areas.marker2[name] = minetest.add_entity(pos, "areas:pos2") |  | ||||||
| 		areas.marker2[name]:get_luaentity().active = true |  | ||||||
| 	end |  | ||||||
| end |  | ||||||
|  |  | ||||||
| minetest.register_entity("areas:pos1", { | minetest.register_entity("areas:pos1", { | ||||||
| 	initial_properties = { | 	initial_properties = { | ||||||
| 		visual = "cube", | 		visual = "cube", | ||||||
| @@ -230,17 +271,10 @@ minetest.register_entity("areas:pos1", { | |||||||
| 		            "areas_pos1.png", "areas_pos1.png", | 		            "areas_pos1.png", "areas_pos1.png", | ||||||
| 		            "areas_pos1.png", "areas_pos1.png"}, | 		            "areas_pos1.png", "areas_pos1.png"}, | ||||||
| 		collisionbox = {-0.55, -0.55, -0.55, 0.55, 0.55, 0.55}, | 		collisionbox = {-0.55, -0.55, -0.55, 0.55, 0.55, 0.55}, | ||||||
|  | 		hp_max = 1, | ||||||
|  | 		armor_groups = {fleshy=100}, | ||||||
|  | 		static_save = false, | ||||||
| 	}, | 	}, | ||||||
| 	on_step = function(self, dtime) |  | ||||||
| 		if self.active == nil then |  | ||||||
| 			self.object:remove() |  | ||||||
| 		end |  | ||||||
| 	end, |  | ||||||
| 	on_punch = function(self, hitter) |  | ||||||
| 		self.object:remove() |  | ||||||
| 		local name = hitter:get_player_name() |  | ||||||
| 		areas.marker1[name] = nil |  | ||||||
| 	end, |  | ||||||
| }) | }) | ||||||
|  |  | ||||||
| minetest.register_entity("areas:pos2", { | minetest.register_entity("areas:pos2", { | ||||||
| @@ -251,15 +285,8 @@ minetest.register_entity("areas:pos2", { | |||||||
| 		            "areas_pos2.png", "areas_pos2.png", | 		            "areas_pos2.png", "areas_pos2.png", | ||||||
| 		            "areas_pos2.png", "areas_pos2.png"}, | 		            "areas_pos2.png", "areas_pos2.png"}, | ||||||
| 		collisionbox = {-0.55, -0.55, -0.55, 0.55, 0.55, 0.55}, | 		collisionbox = {-0.55, -0.55, -0.55, 0.55, 0.55, 0.55}, | ||||||
|  | 		hp_max = 1, | ||||||
|  | 		armor_groups = {fleshy=100}, | ||||||
|  | 		static_save = false, | ||||||
| 	}, | 	}, | ||||||
| 	on_step = function(self, dtime) |  | ||||||
| 		if self.active == nil then |  | ||||||
| 			self.object:remove() |  | ||||||
| 		end |  | ||||||
| 	end, |  | ||||||
| 	on_punch = function(self, hitter) |  | ||||||
| 		self.object:remove() |  | ||||||
| 		local name = hitter:get_player_name() |  | ||||||
| 		areas.marker2[name] = nil |  | ||||||
| 	end, |  | ||||||
| }) | }) | ||||||
|   | |||||||
| @@ -3,6 +3,20 @@ | |||||||
| # Static paths do not work well with settings | # Static paths do not work well with settings | ||||||
| #areas.filename (Configuration file path) string (world_path)/areas.dat | #areas.filename (Configuration file path) string (world_path)/areas.dat | ||||||
|  |  | ||||||
|  | # Use smallest area volume precedence concept. (experimental; may change) | ||||||
|  | # | ||||||
|  | # If set to `true`: | ||||||
|  | #    The interaction permission is defined by the smallest area volume that | ||||||
|  | #    contains the interaction position. Granting access to areas is achieved | ||||||
|  | #    by factions instead of using `/add_owner`. | ||||||
|  | #    This allows players to have private areas within a greater open/shared | ||||||
|  | #    area and also define open/shared areas within those private areas. | ||||||
|  | # If set to `false`: (default) | ||||||
|  | #    Interacting is permitted if the interaction position resides in any of the | ||||||
|  | #    player's own areas, shared or open areas. | ||||||
|  | #    This permission is not impacted by more restrictive, intersecting areas. | ||||||
|  | areas.use_smallest_area_precedence (Smallest area rules) bool false | ||||||
|  |  | ||||||
| # Allow players with a privilege create their own areas using /protect | # Allow players with a privilege create their own areas using /protect | ||||||
| # within the specified size and amount limits. | # within the specified size and amount limits. | ||||||
| areas.self_protection (Self protection) bool false | areas.self_protection (Self protection) bool false | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user