code:
-- Since the doors mod has changed in the latest daily builds I have taken the
-- WTFPL licenced code from the old doors mod and included an edited version
-- within this mod for local use.

local S = protector.intllib
local F = minetest.formspec_escape

-- MineClone2 support
local mcl = not minetest.registered_items["default:steel_ingot"]

-- Registers a door
function register_door(name, def)
	def.groups.not_in_creative_inventory = 1

	local box = {{-0.5, -0.5, -0.5, 0.5, 0.5, -0.5+1.5/16}}

	def.node_box_bottom = box
	def.node_box_top = box
	def.selection_box_bottom = box
	def.selection_box_top = box
	def.sound_close_door  = "doors_door_close"
	def.sound_open_door = "doors_door_open"

	minetest.register_craftitem(name, {
		description = def.description,
		inventory_image = def.inventory_image,

		on_place = function(itemstack, placer, pointed_thing)
			if not pointed_thing.type == "node" then
				return itemstack
			end

			local ptu = pointed_thing.under
			local nu = minetest.get_node(ptu)
			if minetest.registered_nodes[nu.name]
			and minetest.registered_nodes[nu.name].on_rightclick then
				return minetest.registered_nodes[nu.name].on_rightclick(ptu, nu, placer, itemstack)
			end

			local pt = pointed_thing.above
			local pt2 = {x=pt.x, y=pt.y, z=pt.z}
			pt2.y = pt2.y+1
			if
				not minetest.registered_nodes[minetest.get_node(pt).name].buildable_to or
				not minetest.registered_nodes[minetest.get_node(pt2).name].buildable_to or
				not placer or
				not placer:is_player()
			then
				return itemstack
			end

			if minetest.is_protected(pt, placer:get_player_name()) or
					minetest.is_protected(pt2, placer:get_player_name()) then
				minetest.record_protection_violation(pt, placer:get_player_name())
				return itemstack
			end

			local p2 = minetest.dir_to_facedir(placer:get_look_dir())
			local pt3 = {x=pt.x, y=pt.y, z=pt.z}
			if p2 == 0 then
				pt3.x = pt3.x-1
			elseif p2 == 1 then
				pt3.z = pt3.z+1
			elseif p2 == 2 then
				pt3.x = pt3.x+1
			elseif p2 == 3 then
				pt3.z = pt3.z-1
			end
			if minetest.get_item_group(minetest.get_node(pt3).name, "door") == 0 then
				minetest.set_node(pt, {name=name.."_b_1", param2=p2})
				minetest.set_node(pt2, {name=name.."_t_1", param2=p2})
			else
				minetest.set_node(pt, {name=name.."_b_2", param2=p2})
				minetest.set_node(pt2, {name=name.."_t_2", param2=p2})
				minetest.get_meta(pt):set_int("right", 1)
				minetest.get_meta(pt2):set_int("right", 1)
			end

			if not minetest.setting_getbool("creative_mode") then
				itemstack:take_item()
			end
			return itemstack
		end,
	})

	local tt = def.tiles_top
	local tb = def.tiles_bottom

	local function after_dig_node(pos, name, digger)
		local node = minetest.get_node(pos)
		if node.name == name then
			minetest.node_dig(pos, node, digger)
		end
	end

	local function on_rightclick(pos, dir, check_name, replace, replace_dir, params)
		pos.y = pos.y+dir
		if minetest.get_node(pos).name ~= check_name then
			return
		end
		local p2 = minetest.get_node(pos).param2
		p2 = params[p2+1]

		minetest.swap_node(pos, {name=replace_dir, param2=p2})

		pos.y = pos.y-dir
		minetest.swap_node(pos, {name=replace, param2=p2})

		local snd_1 = def.sound_close_door
		local snd_2 = def.sound_open_door
		if params[1] == 3 then
			snd_1 = def.sound_open_door
			snd_2 = def.sound_close_door
		end

		if minetest.get_meta(pos):get_int("right") ~= 0 then
			minetest.sound_play(snd_1, {pos = pos, gain = 0.3, max_hear_distance = 10})
		else
			minetest.sound_play(snd_2, {pos = pos, gain = 0.3, max_hear_distance = 10})
		end
	end

	local function on_rotate(pos, node, dir, user, check_name, mode, new_param2)

		if mode ~= screwdriver.ROTATE_FACE then
			return false
		end

		pos.y = pos.y + dir
		if not minetest.get_node(pos).name == check_name then
			return false
		end
		if minetest.is_protected(pos, user:get_player_name()) then
			minetest.record_protection_violation(pos, user:get_player_name())
			return false
		end

		local node2 = minetest.get_node(pos)
		node2.param2 = (node2.param2 + 1) % 4
		minetest.swap_node(pos, node2)

		pos.y = pos.y - dir
		node.param2 = (node.param2 + 1) % 4
		minetest.swap_node(pos, node)
		return true
	end

	minetest.register_node(name.."_b_1", {
		tiles = {tb[2], tb[2], tb[2], tb[2], tb[1], tb[1].."^[transformfx"},
		paramtype = "light",
		paramtype2 = "facedir",
		is_ground_content = false,
		drop = name,
		drawtype = "nodebox",
		node_box = {
			type = "fixed",
			fixed = def.node_box_bottom
		},
		selection_box = {
			type = "fixed",
			fixed = def.selection_box_bottom
		},
		groups = def.groups,

		after_dig_node = function(pos, oldnode, oldmetadata, digger)
			pos.y = pos.y+1
			after_dig_node(pos, name.."_t_1", digger)
		end,

		on_rightclick = function(pos, node, clicker)
			if not minetest.is_protected(pos, clicker:get_player_name()) then
				on_rightclick(pos, 1, name.."_t_1", name.."_b_2", name.."_t_2", {1,2,3,0})
			end
		end,

		on_rotate = function(pos, node, user, mode, new_param2)
			return on_rotate(pos, node, 1, user, name.."_t_1", mode)
		end,

		sounds = def.sounds,
		sunlight_propagates = def.sunlight,
		on_blast = function() end,
	})

	minetest.register_node(name.."_t_1", {
		tiles = {tt[2], tt[2], tt[2], tt[2], tt[1], tt[1].."^[transformfx"},
		paramtype = "light",
		paramtype2 = "facedir",
		is_ground_content = false,
		drop = "",
		drawtype = "nodebox",
		node_box = {
			type = "fixed",
			fixed = def.node_box_top
		},
		selection_box = {
			type = "fixed",
			fixed = def.selection_box_top
		},
		groups = def.groups,

		after_dig_node = function(pos, oldnode, oldmetadata, digger)
			pos.y = pos.y-1
			after_dig_node(pos, name.."_b_1", digger)
		end,

		on_rightclick = function(pos, node, clicker)
			if not minetest.is_protected(pos, clicker:get_player_name()) then
				on_rightclick(pos, -1, name.."_b_1", name.."_t_2", name.."_b_2", {1,2,3,0})
			end
		end,

		on_rotate = function(pos, node, user, mode, new_param2)
			return on_rotate(pos, node, -1, user, name.."_b_1", mode)
		end,

		sounds = def.sounds,
		sunlight_propagates = def.sunlight,
		on_blast = function() end,
	})

	minetest.register_node(name.."_b_2", {
		tiles = {tb[2], tb[2], tb[2], tb[2], tb[1].."^[transformfx", tb[1]},
		paramtype = "light",
		paramtype2 = "facedir",
		is_ground_content = false,
		drop = name,
		drawtype = "nodebox",
		node_box = {
			type = "fixed",
			fixed = def.node_box_bottom
		},
		selection_box = {
			type = "fixed",
			fixed = def.selection_box_bottom
		},
		groups = def.groups,

		after_dig_node = function(pos, oldnode, oldmetadata, digger)
			pos.y = pos.y+1
			after_dig_node(pos, name.."_t_2", digger)
		end,

		on_rightclick = function(pos, node, clicker)
			if not minetest.is_protected(pos, clicker:get_player_name()) then
				on_rightclick(pos, 1, name.."_t_2", name.."_b_1", name.."_t_1", {3,0,1,2})
			end
		end,

		on_rotate = function(pos, node, user, mode, new_param2)
			return on_rotate(pos, node, 1, user, name.."_t_2", mode)
		end,

		sounds = def.sounds,
		sunlight_propagates = def.sunlight,
		on_blast = function() end,
	})

	minetest.register_node(name.."_t_2", {
		tiles = {tt[2], tt[2], tt[2], tt[2], tt[1].."^[transformfx", tt[1]},
		paramtype = "light",
		paramtype2 = "facedir",
		is_ground_content = false,
		drop = "",
		drawtype = "nodebox",
		node_box = {
			type = "fixed",
			fixed = def.node_box_top
		},
		selection_box = {
			type = "fixed",
			fixed = def.selection_box_top
		},
		groups = def.groups,

		after_dig_node = function(pos, oldnode, oldmetadata, digger)
			pos.y = pos.y-1
			after_dig_node(pos, name.."_b_2", digger)
		end,

		on_rightclick = function(pos, node, clicker)
			if not minetest.is_protected(pos, clicker:get_player_name()) then
				on_rightclick(pos, -1, name.."_b_2", name.."_t_1", name.."_b_1", {3,0,1,2})
			end
		end,

		on_rotate = function(pos, node, user, mode, new_param2)
			return on_rotate(pos, node, -1, user, name.."_b_2", mode)
		end,

		sounds = def.sounds,
		sunlight_propagates = def.sunlight,
		on_blast = function() end,
	})

end

-- Protected Wooden Door

local name = "protector:door_wood"

register_door(name, {
	description = S("Protected Wooden Door"),
	inventory_image = "doors_wood.png^protector_logo.png",
	groups = {
		snappy = 1, choppy = 2, oddly_breakable_by_hand = 2,
		unbreakable = 1, --door = 1
	},
	tiles_bottom = {"doors_wood_b.png^protector_logo.png", "doors_brown.png"},
	tiles_top = {"doors_wood_a.png", "doors_brown.png"},
	sounds = default.node_sound_wood_defaults(),
	sunlight = false,
})

if mcl then
minetest.register_craft({
	output = name,
	recipe = {
		{"mcl_doors:wooden_door", "mcl_core:gold_ingot"}
	}
})
else
minetest.register_craft({
	output = name,
	recipe = {
		{"group:wood", "group:wood"},
		{"group:wood", "default:copper_ingot"},
		{"group:wood", "group:wood"}
	}
})

minetest.register_craft({
	output = name,
	recipe = {
		{"doors:door_wood", "default:copper_ingot"}
	}
})
end

-- Protected Steel Door

local name = "protector:door_steel"

register_door(name, {
	description = S("Protected Steel Door"),
	inventory_image = "doors_steel.png^protector_logo.png",
	groups = {
		snappy = 1, bendy = 2, cracky = 1,
		level = 2, unbreakable = 1, -- door = 1
	},
	tiles_bottom = {"doors_steel_b.png^protector_logo.png", "doors_grey.png"},
	tiles_top = {"doors_steel_a.png", "doors_grey.png"},
	sounds = default.node_sound_wood_defaults(),
	sunlight = false,
})

if mcl then
minetest.register_craft({
	output = name,
	recipe = {
		{"mcl_doors:iron_door", "mcl_core:gold_ingot"}
	}
})
else
minetest.register_craft({
	output = name,
	recipe = {
		{"default:steel_ingot", "default:steel_ingot"},
		{"default:steel_ingot", "default:copper_ingot"},
		{"default:steel_ingot", "default:steel_ingot"}
	}
})

minetest.register_craft({
	output = name,
	recipe = {
		{"doors:door_steel", "default:copper_ingot"}
	}
})
end

----trapdoor----

function register_trapdoor(name, def)
	local name_closed = name
	local name_opened = name.."_open"

	def.on_rightclick = function (pos, node, clicker, itemstack, pointed_thing)
		if minetest.is_protected(pos, clicker:get_player_name()) then
			return
		end
		local newname = node.name == name_closed and name_opened or name_closed
		local sound = false
		if node.name == name_closed then sound = "doors_door_open" end
		if node.name == name_opened then sound = "doors_door_close" end
		if sound then
			minetest.sound_play(sound, {pos = pos, gain = 0.3, max_hear_distance = 10})
		end
		minetest.swap_node(pos, {name = newname, param1 = node.param1, param2 = node.param2})
	end

	-- Common trapdoor configuration
	def.drawtype = "nodebox"
	def.paramtype = "light"
	def.paramtype2 = "facedir"
	def.is_ground_content = false

	local def_opened = table.copy(def)
	local def_closed = table.copy(def)

	def_closed.node_box = {
		type = "fixed",
		fixed = {-0.5, -0.5, -0.5, 0.5, -6/16, 0.5}
	}
	def_closed.selection_box = {
		type = "fixed",
		fixed = {-0.5, -0.5, -0.5, 0.5, -6/16, 0.5}
	}
	def_closed.tiles = { def.tile_front, def.tile_front, def.tile_side, def.tile_side,
		def.tile_side, def.tile_side }

	def_opened.node_box = {
		type = "fixed",
		fixed = {-0.5, -0.5, 6/16, 0.5, 0.5, 0.5}
	}
	def_opened.selection_box = {
		type = "fixed",
		fixed = {-0.5, -0.5, 6/16, 0.5, 0.5, 0.5}
	}
	def_opened.tiles = { def.tile_side, def.tile_side,
			def.tile_side .. "^[transform3",
			def.tile_side .. "^[transform1",
			def.tile_front, def.tile_front }

	def_opened.drop = name_closed
	def_opened.groups.not_in_creative_inventory = 1

	minetest.register_node(name_opened, def_opened)
	minetest.register_node(name_closed, def_closed)
end

-- Protected Wooden Trapdoor

register_trapdoor("protector:trapdoor", {
	description = S("Protected Trapdoor"),
	inventory_image = "doors_trapdoor.png^protector_logo.png",
	wield_image = "doors_trapdoor.png^protector_logo.png",
	tile_front = "doors_trapdoor.png^protector_logo.png",
	tile_side = "doors_trapdoor_side.png",
	groups = {
		snappy = 1, choppy = 2, oddly_breakable_by_hand = 2,
		unbreakable = 1, --door = 1
	},
	sounds = default.node_sound_wood_defaults(),
})

if mcl then
minetest.register_craft({
	output = "protector:trapdoor",
	recipe = {
		{"mcl_doors:trapdoor", "mcl_core:gold_ingot"}
	}
})
else
minetest.register_craft({
	output = "protector:trapdoor 2",
	recipe = {
		{"group:wood", "default:copper_ingot", "group:wood"},
		{"group:wood", "group:wood", "group:wood"},
	}
})

minetest.register_craft({
	output = "protector:trapdoor",
	recipe = {
		{"doors:trapdoor", "default:copper_ingot"}
	}
})
end

-- Protected Steel Trapdoor

register_trapdoor("protector:trapdoor_steel", {
	description = S("Protected Steel Trapdoor"),
	inventory_image = "doors_trapdoor_steel.png^protector_logo.png",
	wield_image = "doors_trapdoor_steel.png^protector_logo.png",
	tile_front = "doors_trapdoor_steel.png^protector_logo.png",
	tile_side = "doors_trapdoor_steel_side.png",
	groups = {
		snappy = 1, bendy = 2, cracky = 1, melty = 2, level = 2,
		unbreakable = 1, --door = 1
	},
	sounds = default.node_sound_wood_defaults(),
})

if mcl then
minetest.register_craft({
	output = "protector:trapdoor_steel",
	recipe = {
		{"mcl_doors:iron_trapdoor", "mcl_core:gold_ingot"}
	}
})
else
minetest.register_craft({
	output = "protector:trapdoor_steel",
	recipe = {
		{"default:copper_ingot", "default:steel_ingot"},
		{"default:steel_ingot", "default:steel_ingot"},
	}
})

minetest.register_craft({
	output = "protector:trapdoor_steel",
	recipe = {
		{"doors:trapdoor_steel", "default:copper_ingot"}
	}
})
end

-- Protected Chest

minetest.register_node("protector:chest", {
	description = S("Protected Chest"),
	tiles = {
		"default_chest_top.png", "default_chest_top.png",
		"default_chest_side.png", "default_chest_side.png",
		"default_chest_side.png", "default_chest_front.png^protector_logo.png"
	},
	paramtype2 = "facedir",
	groups = {choppy = 2, oddly_breakable_by_hand = 2, unbreakable = 1},
	legacy_facedir_simple = true,
	is_ground_content = false,
	sounds = default.node_sound_wood_defaults(),

	on_construct = function(pos)

		local meta = minetest.get_meta(pos)
		local inv = meta:get_inventory()

		meta:set_string("infotext", S("Protected Chest"))
		meta:set_string("name", "")
		inv:set_size("main", 8 * 4)
	end,

	can_dig = function(pos,player)

		local meta = minetest.get_meta(pos)
		local inv = meta:get_inventory()

		if inv:is_empty("main") then

			if not minetest.is_protected(pos, player:get_player_name()) then
				return true
			end
		end
	end,

	on_metadata_inventory_put = function(pos, listname, index, stack, player)

		minetest.log("action", player:get_player_name() ..
			" moves stuff to protected chest at " ..
			minetest.pos_to_string(pos))
	end,

	on_metadata_inventory_take = function(pos, listname, index, stack, player)

		minetest.log("action", player:get_player_name() ..
			" takes stuff from protected chest at " ..
			minetest.pos_to_string(pos))
	end,

	on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)

		minetest.log("action", player:get_player_name() ..
			" moves stuff inside protected chest at " ..
			minetest.pos_to_string(pos))
	end,

	allow_metadata_inventory_put = function(pos, listname, index, stack, player)

		if minetest.is_protected(pos, player:get_player_name()) then
			return 0
		end

		return stack:get_count()
	end,

	allow_metadata_inventory_take = function(pos, listname, index, stack, player)

		if minetest.is_protected(pos, player:get_player_name()) then
			return 0
		end

		return stack:get_count()
	end,

	allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)

		if minetest.is_protected(pos, player:get_player_name()) then
			return 0
		end

		return count
	end,

	on_rightclick = function(pos, node, clicker)

		if minetest.is_protected(pos, clicker:get_player_name()) then
			return
		end

		local meta = minetest.get_meta(pos)

		if not meta then
			return
		end

		local spos = pos.x .. "," .. pos.y .. "," ..pos.z
		local formspec = "size[8,9]"
--			.. default.gui_bg
--			.. default.gui_bg_img
--			.. default.gui_slots
			.. "list[nodemeta:".. spos .. ";main;0,0.3;8,4;]"
			.. "button[0,4.5;2,0.25;toup;" .. F(S("To Chest")) .. "]"
			.. "field[2.3,4.8;4,0.25;chestname;;"
			.. meta:get_string("name") .. "]"
			.. "button[6,4.5;2,0.25;todn;" .. F(S("To Inventory")) .. "]"
			.. "list[current_player;main;0,5;8,1;]"
			.. "list[current_player;main;0,6.08;8,3;8]"
			.. "listring[nodemeta:" .. spos .. ";main]"
			.. "listring[current_player;main]"

			minetest.show_formspec(
				clicker:get_player_name(),
				"protector:chest_" .. minetest.pos_to_string(pos),
				formspec)
	end,

	on_blast = function() end,
})

-- Protected Chest formspec buttons

minetest.register_on_player_receive_fields(function(player, formname, fields)

	if string.sub(formname, 0, string.len("protector:chest_")) ~= "protector:chest_" then
		return
	end

	local pos_s = string.sub(formname,string.len("protector:chest_") + 1)
	local pos = minetest.string_to_pos(pos_s)

	if minetest.is_protected(pos, player:get_player_name()) then
		return
	end

	local meta = minetest.get_meta(pos) ; if not meta then return end
	local chest_inv = meta:get_inventory() ; if not chest_inv then return end
	local player_inv = player:get_inventory()
	local leftover

	if fields.toup then

		-- copy contents of players inventory to chest
		for i, v in ipairs(player_inv:get_list("main") or {}) do

			if chest_inv:room_for_item("main", v) then

				leftover = chest_inv:add_item("main", v)

				player_inv:remove_item("main", v)

				if leftover
				and not leftover:is_empty() then
					player_inv:add_item("main", v)
				end
			end
		end

	elseif fields.todn then

		-- copy contents of chest to players inventory
		for i, v in ipairs(chest_inv:get_list("main") or {}) do

			if player_inv:room_for_item("main", v) then

				leftover = player_inv:add_item("main", v)

				chest_inv:remove_item("main", v)

				if leftover
				and not leftover:is_empty() then
					chest_inv:add_item("main", v)
				end
			end
		end

	elseif fields.chestname then

		-- change chest infotext to display name
		if fields.chestname ~= "" then

			meta:set_string("name", fields.chestname)
			meta:set_string("infotext",
				S("Protected Chest (@1)", fields.chestname))
		else
			meta:set_string("infotext", S("Protected Chest"))
		end

	end
end)

-- Protected Chest recipes

if mcl then
minetest.register_craft({
	output = "protector:chest",
	recipe = {
		{"mcl_chests:chest", "mcl_core:gold_ingot"},
	}
})
else
minetest.register_craft({
	output = "protector:chest",
	recipe = {
		{"group:wood", "group:wood", "group:wood"},
		{"group:wood", "default:copper_ingot", "group:wood"},
		{"group:wood", "group:wood", "group:wood"},
	}
})

minetest.register_craft({
	output = "protector:chest",
	recipe = {
		{"default:chest", "default:copper_ingot"},
	}
})
end


code:
local S = protector.intllib
local radius = (tonumber(minetest.setting_get("protector_radius")) or 5)
local hud = {}
local hud_timer = 0
local hud_interval = (tonumber(minetest.setting_get("protector_hud_interval")) or 5)

if hud_interval > 0 then
minetest.register_globalstep(function(dtime)

	-- every 5 seconds
	hud_timer = hud_timer + dtime
	if hud_timer < hud_interval then
		return
	end
	hud_timer = 0

	for _, player in pairs(minetest.get_connected_players()) do

		local name = player:get_player_name()
		local pos = vector.round(player:get_pos())
		local hud_text = ""

		local protectors = minetest.find_nodes_in_area(
			{x = pos.x - radius , y = pos.y - radius , z = pos.z - radius},
			{x = pos.x + radius , y = pos.y + radius , z = pos.z + radius},
			{"protector:protect","protector:protect2", "protector:protect_hidden"})

		if #protectors > 0 then
			local npos = protectors[1]
			local meta = minetest.get_meta(npos)
			local nodeowner = meta:get_string("owner")

			hud_text = S("Owner: @1", nodeowner)
		end

		if not hud[name] then

			hud[name] = {}

			hud[name].id = player:hud_add({
				hud_elem_type = "text",
				name = "Protector Area",
				number = 0xFFFF22,
				position = {x = 0, y = 0.95},
				offset = {x = 8, y = -8},
				text = hud_text,
				scale = {x = 200, y = 60},
				alignment = {x = 1, y = -1},
			})

			return
		else
			player:hud_change(hud[name].id, "text", hud_text)
		end
	end
end)

minetest.register_on_leaveplayer(function(player)
	hud[player:get_player_name()] = nil
end)

end

repo_name: louisroyer/protector

license: mit


code:
-- default support (for use with MineClone2 and other [games]
default = default or {
	node_sound_stone_defaults = function(table) end,
	node_sound_wood_defaults = function(table) end,
	gui_bg = "",
	gui_bg_img = "",
	gui_slots = "",
}

-- Load support for intllib.
local MP = minetest.get_modpath(minetest.get_current_modname())
local F = minetest.formspec_escape
local S = minetest.get_translator and minetest.get_translator("protector") or
		dofile(MP .. "/intllib.lua")

-- Load support for factions
local factions_available = minetest.global_exists("factions")

protector = {
	mod = "redo",
	modpath = MP,
	intllib = S
}

local protector_max_share_count = 12
-- get minetest.conf settings
local protector_radius = tonumber(minetest.settings:get("protector_radius")) or 5
local protector_flip = minetest.settings:get_bool("protector_flip") or false
local protector_hurt = tonumber(minetest.settings:get("protector_hurt")) or 0
local protector_spawn = tonumber(minetest.settings:get("protector_spawn")
	or minetest.settings:get("protector_pvp_spawn")) or 0
local protector_show = tonumber(minetest.settings:get("protector_show_interval")) or 5
local protector_recipe = minetest.settings:get_bool("protector_recipe") ~= false
local protector_msg = minetest.settings:get_bool("protector_msg") ~= false

-- get static spawn position
local statspawn = minetest.string_to_pos(minetest.settings:get("static_spawnpoint"))
		or {x = 0, y = 2, z = 0}

-- return list of members as a table
local get_member_list = function(meta)

	return meta:get_string("members"):split(" ")
end

-- write member list table in protector meta as string
local set_member_list = function(meta, list)

	meta:set_string("members", table.concat(list, " "))
end

-- check for owner name
local is_owner = function(meta, name)

	return name == meta:get_string("owner")
end

-- check for member name
local is_member = function (meta, name)

	if factions_available
	and meta:get_int("faction_members") == 1 then
		if factions.version == nil then
			-- backward compatibility
			if factions.get_player_faction(name) ~= nil
			and factions.get_player_faction(meta:get_string("owner")) ==
					factions.get_player_faction(name) then
				return true
			end
		else
			-- is member if player and owner share at least one faction
			local owner_factions = factions.get_player_factions(name)
			for _, f in ipairs(owner_factions) do
				if factions.player_is_in_faction(f, owner) then
					return true
				end
			end
		end
	end

	for _, n in pairs(get_member_list(meta)) do

		if n == name then
			return true
		end
	end

	return false
end

-- add player name to table as member
local add_member = function(meta, name)

	-- Constant (20) defined by player.h
	if name:len() > 25 then
		return
	end

	-- does name already exist?
	if is_owner(meta, name)
	or is_member(meta, name) then
		return
	end

	local list = get_member_list(meta)

	if #list >= protector_max_share_count then
		return
	end

	table.insert(list, name)

	set_member_list(meta, list)
end

-- remove player name from table
local del_member = function(meta, name)

	local list = get_member_list(meta)

	for i, n in pairs(list) do

		if n == name then
			table.remove(list, i)
			break
		end
	end

	set_member_list(meta, list)
end

-- protector interface
local protector_formspec = function(meta)

	local formspec = "size[8,7]"
		.. default.gui_bg
		.. default.gui_bg_img
		.. default.gui_slots
		.. "label[2.5,0;" .. F(S("-- Protector interface --")) .. "]"
		.. "label[0,1;" .. F(S("PUNCH node to show protected area")) .. "]"
		.. "label[0,2;" .. F(S("Members:")) .. "]"
		.. "button_exit[2.5,6.2;3,0.5;close_me;" .. F(S("Close")) .. "]"
		.. "field_close_on_enter[protector_add_member;false]"

	local members = get_member_list(meta)
	local npp = protector_max_share_count -- max users added to protector list
	local i = 0

	local checkbox_faction = false

	-- Display the checkbox only if the owner is member of at least 1 faction
	if factions_available then
		if factions.version == nil then
			-- backward compatibility
			if factions.get_player_faction(meta:get_string("owner")) then
				checkbox_faction = true
			end
		else
			if next(factions.get_player_faction(meta:get_string("owner"))) then
				checkbox_faction = true
			end
		end
	end
	if checkbox_faction then
		formspec = formspec .. "checkbox[0,5;faction_members;"
			.. F(S("Allow faction access"))
			.. ";" .. (meta:get_int("faction_members") == 1 and
					"true" or "false") .. "]"

		if npp > 8 then
			npp = 8
		end
	end

	for n = 1, #members do

		if i < npp then

			-- show username
			formspec = formspec .. "button[" .. (i % 4 * 2)
			.. "," .. math.floor(i / 4 + 3)
			.. ";1.5,.5;protector_member;" .. F(members[n]) .. "]"

			-- username remove button
			.. "button[" .. (i % 4 * 2 + 1.25) .. ","
			.. math.floor(i / 4 + 3)
			.. ";.75,.5;protector_del_member_" .. F(members[n]) .. ";X]"
		end

		i = i + 1
	end

	if i < npp then

		-- user name entry field
		formspec = formspec .. "field[" .. (i % 4 * 2 + 1 / 3) .. ","
		.. (math.floor(i / 4 + 3) + 1 / 3)
		.. ";1.433,.5;protector_add_member;;]"

		-- username add button
		.."button[" .. (i % 4 * 2 + 1.25) .. ","
		.. math.floor(i / 4 + 3) .. ";.75,.5;protector_submit;+]"

	end

	return formspec
end

-- check if pos is inside a protected spawn area
local inside_spawn = function(pos, radius)

	if protector_spawn <= 0 then
		return false
	end

	if pos.x < statspawn.x + radius
	and pos.x > statspawn.x - radius
	and pos.y < statspawn.y + radius
	and pos.y > statspawn.y - radius
	and pos.z < statspawn.z + radius
	and pos.z > statspawn.z - radius then

		return true
	end

	return false
end

-- show protection message if enabled
local show_msg = function(player, msg)

	-- if messages disabled or no player name provided
	if protector_msg == false or not player or player == "" then
		return
	end

	minetest.chat_send_player(player, msg)
end

-- Infolevel:
-- 0 for no info
-- 1 for "This area is owned by <owner> !" if you can't dig
-- 2 for "This area is owned by <owner>.
-- 3 for checking protector overlaps

protector.can_dig = function(r, pos, digger, onlyowner, infolevel)

	if not digger or not pos then
		return false
	end

	-- protector_bypass privileged users can override protection
	if infolevel == 1
	and minetest.check_player_privs(digger, {protection_bypass = true}) then
		return true
	end

	-- infolevel 3 is only used to bypass priv check, change to 1 now
	if infolevel == 3 then infolevel = 1 end

	-- is spawn area protected ?
	if inside_spawn(pos, protector_spawn) then

		show_msg(digger,
			S("Spawn @1 has been protected up to a @2 block radius.",
				minetest.pos_to_string(statspawn), protector_spawn))

		return false
	end

	-- find the protector nodes
	local pos = minetest.find_nodes_in_area(
		{x = pos.x - r, y = pos.y - r, z = pos.z - r},
		{x = pos.x + r, y = pos.y + r, z = pos.z + r},
		{"protector:protect", "protector:protect2", "protector:protect_hidden"})

	local meta, owner, members

	for n = 1, #pos do

		meta = minetest.get_meta(pos[n])
		owner = meta:get_string("owner") or ""
		members = meta:get_string("members") or ""

		-- node change and digger isn't owner
		if infolevel == 1 and owner ~= digger then

			-- and you aren't on the member list
			if onlyowner or not is_member(meta, digger) then

				show_msg(digger,
					S("This area is owned by @1", owner) .. "!")

				return false
			end
		end

		-- when using protector as tool, show protector information
		if infolevel == 2 then

			minetest.chat_send_player(digger,
				S("This area is owned by @1", owner) .. ".")

			minetest.chat_send_player(digger,
				S("Protection located at: @1", minetest.pos_to_string(pos[n])))

			if members ~= "" then

				minetest.chat_send_player(digger, S("Members: @1.", members))
			end

			return false
		end

	end

	-- show when you can build on unprotected area
	if infolevel == 2 then

		if #pos < 1 then

			minetest.chat_send_player(digger, S("This area is not protected."))
		end

		minetest.chat_send_player(digger, S("You can build here."))
	end

	return true
end

local old_is_protected = minetest.is_protected

-- check for protected area, return true if protected and digger isn't on list
function minetest.is_protected(pos, digger)

	digger = digger or "" -- nil check

	-- is area protected against digger?
	if not protector.can_dig(protector_radius, pos, digger, false, 1) then

		local player = minetest.get_player_by_name(digger)

		if player and player:is_player() then

			-- hurt player if protection violated
			if protector_hurt > 0 and player:get_hp() > 0 then

				-- This delay fixes item duplication bug (thanks luk3yx)
				minetest.after(0.1, function()
					player:set_hp(player:get_hp() - protector_hurt)
				end)
			end

			-- flip player when protection violated
			if protector_flip then

				-- yaw + 180°
				local yaw = player:get_look_horizontal() + math.pi

				if yaw > 2 * math.pi then
					yaw = yaw - 2 * math.pi
				end

				player:set_look_horizontal(yaw)

				-- invert pitch
				player:set_look_vertical(-player:get_look_vertical())

				-- if digging below player, move up to avoid falling through hole
				local pla_pos = player:get_pos()

				if pos.y < pla_pos.y then

					player:set_pos({
						x = pla_pos.x,
						y = pla_pos.y + 0.8,
						z = pla_pos.z
					})
				end
			end
		end

		return true
	end

	-- otherwise can dig or place
	return old_is_protected(pos, digger)
end

-- make sure protection block doesn't overlap another protector's area
local check_overlap = function(itemstack, placer, pointed_thing)

	if pointed_thing.type ~= "node" then
		return itemstack
	end

	local pos = pointed_thing.above
	local name = placer:get_player_name()

	-- make sure protector doesn't overlap onto protected spawn area
	if inside_spawn(pos, protector_spawn + protector_radius) then

		minetest.chat_send_player(name,
			S("Spawn @1 has been protected up to a @2 block radius.",
			minetest.pos_to_string(statspawn), protector_spawn))

		return itemstack
	end

	-- make sure protector doesn't overlap any other player's area
	if not protector.can_dig(protector_radius * 2, pos, name, true, 3) then

		minetest.chat_send_player(name,
			S("Overlaps into above players protected area"))

		return itemstack
	end

	return minetest.item_place(itemstack, placer, pointed_thing)

end

-- temporary pos store
local player_pos = {}

-- protection node
minetest.register_node("protector:protect", {
	description = S("Protection Block") .. " (" .. S("USE for area check") .. ")",
	drawtype = "nodebox",
	tiles = {
		"default_stone.png^protector_overlay.png",
		"default_stone.png^protector_overlay.png",
		"default_stone.png^protector_overlay.png^protector_logo.png"
	},
	sounds = default.node_sound_stone_defaults(),
	groups = {dig_immediate = 2, unbreakable = 1},
	is_ground_content = false,
	paramtype = "light",
	light_source = 4,

	node_box = {
		type = "fixed",
		fixed = {
			{-0.5 ,-0.5, -0.5, 0.5, 0.5, 0.5},
		}
	},

	on_place = check_overlap,

	after_place_node = function(pos, placer)

		local meta = minetest.get_meta(pos)

		meta:set_string("owner", placer:get_player_name() or "")
		meta:set_string("members", "")
		meta:set_string("infotext",
				S("Protection (owned by @1)", meta:get_string("owner")))
	end,

	on_use = function(itemstack, user, pointed_thing)

		if pointed_thing.type ~= "node" then
			return
		end

		protector.can_dig(protector_radius, pointed_thing.under,
				user:get_player_name(), false, 2)
	end,

	on_rightclick = function(pos, node, clicker, itemstack)

		local meta = minetest.get_meta(pos)
		local name = clicker:get_player_name()

		if meta
		and protector.can_dig(1, pos, name, true, 1) then

			player_pos[name] = pos

			minetest.show_formspec(name, "protector:node", protector_formspec(meta))
		end
	end,

	on_punch = function(pos, node, puncher)

		if minetest.is_protected(pos, puncher:get_player_name()) then
			return
		end

		minetest.add_entity(pos, "protector:display")
	end,

	can_dig = function(pos, player)

		return player and protector.can_dig(1, pos, player:get_player_name(), true, 1)
	end,

	on_blast = function() end,

	after_destruct = function(pos, oldnode)
		local objects = minetest.get_objects_inside_radius(pos, 0.5)
		for _, v in ipairs(objects) do
			v:remove()
		end
	end,
})

-- default recipe and alternative for MineClone2
if protector_recipe then
	if minetest.registered_items["default:stone"] then
	minetest.register_craft({
		output = "protector:protect",
		recipe = {
			{"default:stone", "default:stone", "default:stone"},
			{"default:stone", "default:gold_ingot", "default:stone"},
			{"default:stone", "default:stone", "default:stone"},
		}
	})
	else
	minetest.register_craft({
		output = "protector:protect",
		recipe = {
			{"mcl_core:stone", "mcl_core:stone", "mcl_core:stone"},
			{"mcl_core:stone", "mcl_core:gold_ingot", "mcl_core:stone"},
			{"mcl_core:stone", "mcl_core:stone", "mcl_core:stone"},
		}
	})
	end
end

-- protection logo
minetest.register_node("protector:protect2", {
	description = S("Protection Logo") .. " (" .. S("USE for area check") .. ")",
	tiles = {"protector_logo.png"},
	wield_image = "protector_logo.png",
	inventory_image = "protector_logo.png",
	sounds = default.node_sound_stone_defaults(),
	groups = {dig_immediate = 2, unbreakable = 1},
	paramtype = "light",
	paramtype2 = "wallmounted",
	legacy_wallmounted = true,
	light_source = 4,
	drawtype = "nodebox",
	sunlight_propagates = true,
	walkable = true,
	node_box = {
		type = "wallmounted",
		wall_top    = {-0.375, 0.4375, -0.5, 0.375, 0.5, 0.5},
		wall_bottom = {-0.375, -0.5, -0.5, 0.375, -0.4375, 0.5},
		wall_side   = {-0.5, -0.5, -0.375, -0.4375, 0.5, 0.375},
	},
	selection_box = {type = "wallmounted"},

	on_place = check_overlap,

	after_place_node = function(pos, placer)

		local meta = minetest.get_meta(pos)

		meta:set_string("owner", placer:get_player_name() or "")
		meta:set_string("members", "")
		meta:set_string("infotext",
				S("Protection (owned by @1)", meta:get_string("owner")))
	end,

	on_use = function(itemstack, user, pointed_thing)

		if pointed_thing.type ~= "node" then
			return
		end

		protector.can_dig(protector_radius, pointed_thing.under,
				user:get_player_name(), false, 2)
	end,

	on_rightclick = function(pos, node, clicker, itemstack)

		local meta = minetest.get_meta(pos)
		local name = clicker:get_player_name()

		if meta
		and protector.can_dig(1, pos, name, true, 1) then

			player_pos[name] = pos

			minetest.show_formspec(name, "protector:node", protector_formspec(meta))
		end
	end,

	on_punch = function(pos, node, puncher)

		if minetest.is_protected(pos, puncher:get_player_name()) then
			return
		end

		minetest.add_entity(pos, "protector:display")
	end,

	can_dig = function(pos, player)

		return player and protector.can_dig(1, pos, player:get_player_name(), true, 1)
	end,

	on_blast = function() end,

	after_destruct = function(pos, oldnode)
		local objects = minetest.get_objects_inside_radius(pos, 0.5)
		for _, v in ipairs(objects) do
			v:remove()
		end
	end,
})

-- recipes to switch between protectors
minetest.register_craft({
	type = "shapeless",
	output = "protector:protect",
	recipe = {"protector:protect2"}
})

minetest.register_craft({
	type = "shapeless",
	output = "protector:protect2",
	recipe = {"protector:protect"}
})

-- check formspec buttons or when name entered
minetest.register_on_player_receive_fields(function(player, formname, fields)

	if formname ~= "protector:node" then
		return
	end

	local name = player:get_player_name()
	local pos = player_pos[name]

	if not name or not pos then
		return
	end

	local add_member_input = fields.protector_add_member

	-- reset formspec until close button pressed
	if (fields.close_me or fields.quit)
	and (not add_member_input or add_member_input == "") then
		player_pos[name] = nil
		return
	end

	-- only owner can add names
	if not protector.can_dig(1, pos, player:get_player_name(), true, 1) then
		return
	end

	-- are we adding member to a protection node ? (csm protection)
	local nod = minetest.get_node(pos).name

	if nod ~= "protector:protect"
	and nod ~= "protector:protect2" then
		player_pos[name] = nil
		return
	end

	local meta = minetest.get_meta(pos)

	if not meta then
		return
	end

	-- add faction members
	if factions_available then
		meta:set_int("faction_members", fields.faction_members == "true" and 1 or 0)
	end

	-- add member [+]
	if add_member_input then

		for _, i in pairs(add_member_input:split(" ")) do
			add_member(meta, i)
		end
	end

	-- remove member [x]
	for field, value in pairs(fields) do

		if string.sub(field, 0,
			string.len("protector_del_member_")) == "protector_del_member_" then

			del_member(meta,
				string.sub(field,string.len("protector_del_member_") + 1))
		end
	end

	minetest.show_formspec(name, formname, protector_formspec(meta))
end)

-- display entity shown when protector node is punched
minetest.register_entity("protector:display", {
	physical = false,
	collisionbox = {0, 0, 0, 0, 0, 0},
	visual = "wielditem",
	-- wielditem seems to be scaled to 1.5 times original node size
	visual_size = {x = 0.67, y = 0.67},
	textures = {"protector:display_node"},
	timer = 0,
	glow = 10,

	on_step = function(self, dtime)

		self.timer = self.timer + dtime

		-- remove after set number of seconds
		if self.timer > protector_show then
			self.object:remove()
		end
	end,
})

-- Display-zone node, Do NOT place the display as a node,
-- it is made to be used as an entity (see above)

local x = protector_radius
minetest.register_node("protector:display_node", {
	tiles = {"protector_display.png"},
	use_texture_alpha = true,
	walkable = false,
	drawtype = "nodebox",
	node_box = {
		type = "fixed",
		fixed = {
			-- sides
			{-(x+.55), -(x+.55), -(x+.55), -(x+.45), (x+.55), (x+.55)},
			{-(x+.55), -(x+.55), (x+.45), (x+.55), (x+.55), (x+.55)},
			{(x+.45), -(x+.55), -(x+.55), (x+.55), (x+.55), (x+.55)},
			{-(x+.55), -(x+.55), -(x+.55), (x+.55), (x+.55), -(x+.45)},
			-- top
			{-(x+.55), (x+.45), -(x+.55), (x+.55), (x+.55), (x+.55)},
			-- bottom
			{-(x+.55), -(x+.55), -(x+.55), (x+.55), -(x+.45), (x+.55)},
			-- middle (surround protector)
			{-.55,-.55,-.55, .55,.55,.55},
		},
	},
	selection_box = {
		type = "regular",
	},
	paramtype = "light",
	groups = {dig_immediate = 3, not_in_creative_inventory = 1},
	drop = "",
})

dofile(MP .. "/doors_chest.lua")
dofile(MP .. "/pvp.lua")
dofile(MP .. "/admin.lua")
dofile(MP .. "/tool.lua")
dofile(MP .. "/hud.lua")
dofile(MP .. "/lucky_block.lua")

-- stop mesecon pistons from pushing protectors
if minetest.get_modpath("mesecons_mvps") then
	mesecon.register_mvps_stopper("protector:protect")
	mesecon.register_mvps_stopper("protector:protect2")
	mesecon.register_mvps_stopper("protector:chest")
end

print (S("[MOD] Protector Redo loaded"))


code:
-- Fallback functions for when `intllib` is not installed.
-- Code released under Unlicense <http://unlicense.org>.

-- Get the latest version of this file at:
--   https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua

local function format(str, ...)
	local args = { ... }
	local function repl(escape, open, num, close)
		if escape == "" then
			local replacement = tostring(args[tonumber(num)])
			if open == "" then
				replacement = replacement..close
			end
			return replacement
		else
			return "@"..open..num..close
		end
	end
	return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
end

local gettext, ngettext
if minetest.get_modpath("intllib") then
	if intllib.make_gettext_pair then
		-- New method using gettext.
		gettext, ngettext = intllib.make_gettext_pair()
	else
		-- Old method using text files.
		gettext = intllib.Getter()
	end
end

-- Fill in missing functions.

gettext = gettext or function(msgid, ...)
	return format(msgid, ...)
end

ngettext = ngettext or function(msgid, msgid_plural, n, ...)
	return format(n==1 and msgid or msgid_plural, ...)
end

return gettext, ngettext


code:
# German translation for PROTECTOR MOD.
# Copyright (C) 2018 TenPlus1
# This file is distributed under the same license as the PROTECTOR MOD package.
# Xanthin <xanthin@wiuwiu.de>, 2016.
# CodeXP <codexp@gmx.net>, 2018.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PROTECTOR MOD\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-10 17:33+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: CodeXP <codexp@gmx.net>\n"
"Language-Team: \n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: admin.lua
msgid "Remove Protectors around players (separate names with spaces)"
msgstr "Entferne Störschützer von bestimmten Namen in der Nähe von Spielern (trenne "
"Namen durch Leerzeichen)"

#: admin.lua
msgid "<names list>"
msgstr "<Namensliste der Spieler>"

#: admin.lua
msgid "Replace Protector Owner with name provided"
msgstr "Ersetze Besitzer der Störschützer mit neuem Besitzer"

#: admin.lua
msgid "<owner name> <name to replace with>"
msgstr "<Name des Besitzers> <Name des neuen Besitzers>"

#: admin.lua
msgid "Replacing Protector name '@1' with '@2'"
msgstr "Ersetze Besitzer der Störschützer von '@1' mit '@2'"

#: admin.lua
msgid "Show protected areas of your nearby protectors"
msgstr "Zeige geschützte Bereiche der Störschützer in der Nähe"

#: admin.lua
msgid "Protector Names to remove: @1"
msgstr "Störschutznamen zum Entfernen: @1"

#: admin.lua
msgid "Name List Reset"
msgstr "Namensliste zurückgesetzt"

#: doors_chest.lua
msgid "Protected Wooden Door"
msgstr "Geschützte Holztür"

#: doors_chest.lua
msgid "Protected Steel Door"
msgstr "Geschützte Stahltür"

#: doors_chest.lua
msgid "Protected Trapdoor"
msgstr "Geschützte Falltür"

#: doors_chest.lua
msgid "Protected Steel Trapdoor"
msgstr "Geschützte Stahlfalltür"

#: doors_chest.lua
msgid "Protected Chest"
msgstr "Geschützte Truhe"

#: doors_chest.lua
msgid "To Chest"
msgstr "Zur Truhe"

#: doors_chest.lua
msgid "To Inventory"
msgstr "Zum Inventar"

#: doors_chest.lua
msgid "Protected Chest (@1)"
msgstr "Geschützte Truhe (@1)"

#: init.lua
msgid "-- Protector interface --"
msgstr "-- Störschutz-Interface --"

#: init.lua
msgid "PUNCH node to show protected area"
msgstr "SCHLAGE Node, um geschützten Bereich anzuzeigen oder"

#: init.lua
msgid "USE for area check"
msgstr "BENUTZE für Bereichsprüfung"

#: init.lua
msgid "Members:"
msgstr "Mitglieder:"

#: init.lua
msgid "Close"
msgstr "Schließen"

#: init.lua
msgid "Protection located at: @1"
msgstr "Störschutz befindet sich bei: @1"

#: init.lua
msgid "Members: @1."
msgstr "Mitglieder: @1."

#: init.lua
msgid "This area is not protected."
msgstr "Dieser Bereich ist nicht geschützt."

#: init.lua
msgid "You can build here."
msgstr "Du kannst hier bauen."

#: init.lua tool.lua
msgid "Overlaps into above players protected area"
msgstr "Überlappung im geschützen Bereich eines Spielers"

#: init.lua
msgid "Protection Block"
msgstr "Störschutzblock"

#: admin.lua init.lua tool.lua
msgid "Protection (owned by @1)"
msgstr "Störschutz (gehört @1)"

#: init.lua
msgid "Protection Logo"
msgstr "Störschutzlogo"

#: init.lua
msgid "[MOD] Protector Redo loaded"
msgstr "[MOD] Protector Redo geladen"

#: init.lua
msgid "Spawn @1 has been protected up to a @2 block radius."
msgstr "Spawn @1 ist geschützt mit einem Radius von @2 Blöcke."

#: init.lua
msgid "This area is owned by @1"
msgstr "Dieser Bereich gehört @1"

#: pvp.lua
msgid "[Protector] on_punchplayer called with nil objects"
msgstr "on_punchplayer wurde durch \"nil objects\" aufgerufen"

#: pvp.lua
msgid "[Protector] pvp_protect not active, update your version of Minetest"
msgstr "pvp_protect ist nicht aktiv, aktualisiere deine Minetestversion"

#: pvp.lua
msgid "[Protector] pvp_protect is disabled"
msgstr "pvp_protect ist ausgeschaltet"

#: hud.lua
msgid "Owner: @1"
msgstr "Besitzer: @1"

#: tool.lua
msgid "Protector Placer Tool (stand near protector, face direction and use)"
msgstr ""
"Störschutz Platzier-Werkzeug (stehe neben Störschutz, schaue in die "
"gewünschte Richtung und anwenden)"

#: tool.lua
msgid "Protector already in place!"
msgstr "Störschutz is bereits platziert!"

#: tool.lua
msgid "No protectors available to place!"
msgstr "Keine Störschützer mehr im Inventar!"

#: tool.lua
msgid "Protector placed at @1"
msgstr "Störschutz befindet sich bei: @1"


code:
# Spanish translation for PROTECTOR MOD.
# Copyright (C) 2018 universales
# This file is distributed under the same license as the PROTECTOR MOD package.
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PROTECTOR MOD\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-10 17:33+0200\n"
"PO-Revision-Date: 2020-02-27\n"
"Last-Translator: Universales\n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: admin.lua
msgid "Remove Protectors around players (separate names with spaces)"
msgstr "Eliminar protectores alrededor de los jugadores (nombres separados con espacios)"

#: admin.lua
msgid "<names list>"
msgstr "<Lista de nombres>"

#: admin.lua
msgid "Replace Protector Owner with name provided"
msgstr "Reemplace el propietario del protector con el nombre proporcionado"

#: admin.lua
msgid "<owner name> <name to replace with>"
msgstr "<Nombre del propietario> <Nombre del nuevo propietario>"

#: admin.lua
msgid "Replacing Protector name '@1' with '@2'"
msgstr "Reemplazando el nombre del protector '@1' a '@2'"

#: admin.lua
msgid "Show protected areas of your nearby protectors"
msgstr "Mostrar áreas protegidas de sus protectores cercanos"

#: admin.lua
msgid "Protector Names to remove: @1"
msgstr "Nombres de protectores para eliminar: @1"

#: admin.lua
msgid "Name List Reset"
msgstr "Restablecer lista de nombres"

#: doors_chest.lua
msgid "Protected Wooden Door"
msgstr "Puerta de madera protegida"

#: doors_chest.lua
msgid "Protected Steel Door"
msgstr "Puerta de hierro protegida"

#: doors_chest.lua
msgid "Protected Trapdoor"
msgstr "Trampilla Protegida"

#: doors_chest.lua
msgid "Protected Steel Trapdoor"
msgstr "Trampilla de hierro protegida"

#: doors_chest.lua
msgid "Protected Chest"
msgstr "Cofre protegido"

#: doors_chest.lua
msgid "To Chest"
msgstr "Al cofre"

#: doors_chest.lua
msgid "To Inventory"
msgstr "Al inventario"

#: doors_chest.lua
msgid "Protected Chest (@1)"
msgstr "Cofre protegido (@1)"

#: init.lua
msgid "-- Protector interface --"
msgstr "-- Interfaz del protector --"

#: init.lua
msgid "PUNCH node to show protected area"
msgstr "nodo de perforación para mostrar el área protegida"

#: init.lua
msgid "USE for area check"
msgstr "Usar para chequeo del área"

#: init.lua
msgid "Members:"
msgstr "Miembros:"

#: init.lua
msgid "Close"
msgstr "Cerrar"

#: init.lua
msgid "Protection located at: @1"
msgstr "Protección ubicada en: @1"

#: init.lua
msgid "Members: @1."
msgstr "Miembros: @1."

#: init.lua
msgid "This area is not protected."
msgstr "Esta área no está protegida."

#: init.lua
msgid "You can build here."
msgstr "Puedes construir aquí."

#: init.lua tool.lua
msgid "Overlaps into above players protected area"
msgstr "Se superpone en el área protegida de los jugadores anteriores"

#: init.lua
msgid "Protection Block"
msgstr "Bloque de protección"

#: admin.lua init.lua tool.lua
msgid "Protection (owned by @1)"
msgstr "Protegido (Propiedad de @1)"

#: init.lua
msgid "Protection Logo"
msgstr "Logotipo de la protección"

#: init.lua
msgid "[MOD] Protector Redo loaded"
msgstr "[MOD] Protector recargado"

#: init.lua
msgid "Spawn @1 has been protected up to a @2 block radius."
msgstr "Spawn @1 ha sido protegido hasta un radio de bloque @2."

#: init.lua
msgid "This area is owned by @1"
msgstr "Esta área es propiedad de @1"

#: pvp.lua
msgid "[Protector] on_punchplayer called with nil objects"
msgstr "[Protector] on_punchplayer llamado con objetos nulos."

#: pvp.lua
msgid "[Protector] pvp_protect not active, update your version of Minetest"
msgstr "[Protector] pvp_protect no está activo, actualiza tu versión de Minetest"

#: pvp.lua
msgid "[Protector] pvp_protect is disabled"
msgstr "[Protector] pvp_protect está deshabilitado"

#: hud.lua
msgid "Owner: @1"
msgstr "Propietario: @1"

#: tool.lua
msgid "Protector Placer Tool (stand near protector, face direction and use)"
msgstr ""
"Herramienta de colocación del protector (pararse cerca del protector, dirección de la cara y uso) "

#: tool.lua
msgid "Protector already in place!"
msgstr "¡El protector ya está en este lugar!"

#: tool.lua
msgid "No protectors available to place!"
msgstr "¡No hay protectores disponibles para colocar!"

#: tool.lua
msgid "Protector placed at @1"
msgstr "Protector colocado en @1"


code:
# French translation for PROTECTOR MOD.
# Copyright (C) 2018 TenPlus1
# This file is distributed under the same license as the PROTECTOR MOD package.
# Doloment, 2017.
# CodeXP <codexp@gmx.net>, 2018.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PROTECTOR MOD\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-10 17:33+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: CodeXP <codexp@gmx.net>\n"
"Language-Team: \n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: admin.lua
msgid "Remove Protectors around players (separate names with spaces)"
msgstr "Retirer les protecteurs près des joueurs avec les noms fournis (noms séparés "
"avec des espaces)"

#: admin.lua
msgid "<names list>"
msgstr ""

#: admin.lua
msgid "Replace Protector Owner with name provided"
msgstr ""

#: admin.lua
msgid "<owner name> <name to replace with>"
msgstr ""

#: admin.lua
msgid "Replacing Protector name '@1' with '@2'"
msgstr ""

#: admin.lua
msgid "Show protected areas of your nearby protectors"
msgstr ""

#: admin.lua
msgid "Protector Names to remove: @1"
msgstr "Noms de protecteurs à supprimer: @1"

#: admin.lua
msgid "Name List Reset"
msgstr "Liste de noms réinitialiser"

#: doors_chest.lua
msgid "Protected Wooden Door"
msgstr "Porte en bois protégée"

#: doors_chest.lua
msgid "Protected Steel Door"
msgstr "Porte en acier protégée"

#: doors_chest.lua
msgid "Protected Trapdoor"
msgstr "Trappe protégé"

#: doors_chest.lua
msgid "Protected Steel Trapdoor"
msgstr "Trap en acier protégé"

#: doors_chest.lua
msgid "Protected Chest"
msgstr "Coffre protégé"

#: doors_chest.lua
msgid "To Chest"
msgstr "Vers le coffre"

#: doors_chest.lua
msgid "To Inventory"
msgstr "Vers l'inventaire"

#: doors_chest.lua
msgid "Protected Chest (@1)"
msgstr "Coffre protégé (@1)"

#: init.lua
msgid "-- Protector interface --"
msgstr "-- Interface Protector --"

#: init.lua
msgid "PUNCH node to show protected area"
msgstr "TAPÉ le bloc pour afficher la zone protégée"

#: init.lua
msgid "USE for area check"
msgstr "UTILISER pour vérifier la zone"

#: init.lua
msgid "Members:"
msgstr "Membres:"

#: init.lua
msgid "Close"
msgstr "Fermer"

#: init.lua
msgid "Protection located at: @1"
msgstr "Protection située à: @1"

#: init.lua
msgid "Members: @1."
msgstr "Membres: @1."

#: init.lua
msgid "This area is not protected."
msgstr "Cette zone n'est pas protégée."

#: init.lua
msgid "You can build here."
msgstr "Vous pouvez construire ici."

#: init.lua tool.lua
msgid "Overlaps into above players protected area"
msgstr "Vous chevauché une zone protégé."

#: init.lua
msgid "Protection Block"
msgstr "Bloc de protection"

#: admin.lua init.lua tool.lua
msgid "Protection (owned by @1)"
msgstr "Protection (détenue par @1)"

#: init.lua
msgid "Protection Logo"
msgstr "Logo de protection"

#: init.lua
msgid "[MOD] Protector Redo loaded"
msgstr "[MOD] Protector Redo chargé"

#: init.lua
msgid "Spawn @1 has been protected up to a @2 block radius."
msgstr ""

#: init.lua
#, fuzzy
msgid "This area is owned by @1"
msgstr "Cette zone appartient à @1!"

#: pvp.lua
msgid "[Protector] on_punchplayer called with nil objects"
msgstr "[Protector] on_punchplayer appelé avec des objets nil"

#: pvp.lua
msgid "[Protector] pvp_protect not active, update your version of Minetest"
msgstr ""
"[Protector] pvp_protect est désactivé, mettez à jour votre version de "
"Minetest"

#: pvp.lua
msgid "[Protector] pvp_protect is disabled"
msgstr "[Protector] pvp_protect est désactivé"

#: hud.lua
msgid "Owner: @1"
msgstr ""

#: tool.lua
msgid "Protector Placer Tool (stand near protector, face direction and use)"
msgstr ""

#: tool.lua
msgid "Protector already in place!"
msgstr ""

#: tool.lua
msgid "No protectors available to place!"
msgstr ""

#: tool.lua
msgid "Protector placed at @1"
msgstr "Protection située à: @1"


code:
# Italian translation for PROTECTOR MOD.
# Copyright (C) 2020 Hamlet
# This file is distributed under the same license as the PROTECTOR MOD package.
# Xanthin <xanthin@wiuwiu.de>, 2016.
# CodeXP <codexp@gmx.net>, 2018.
#
msgid ""
msgstr ""
"Project-Id-Version: PROTECTOR MOD\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-10 17:33+0200\n"
"PO-Revision-Date: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.2.1\n"
"Last-Translator: Hamlet <hamlatgitlab@riseup.net>\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: it\n"

#: admin.lua
msgid "Remove Protectors around players (separate names with spaces)"
msgstr "Elimina i protettori attorno ai giocatori (separa i nomi con gli spazi)"

#: admin.lua
msgid "<names list>"
msgstr "<elenco nomi>"

#: admin.lua
msgid "Replace Protector Owner with name provided"
msgstr "Sostituisci il proprietario del protettore col nome fornito"

#: admin.lua
msgid "<owner name> <name to replace with>"
msgstr "<nome proprietario> <nome con cui sostituirlo>"

#: admin.lua
msgid "Replacing Protector name '@1' with '@2'"
msgstr "Sostituzione del nome del protettore '@1' con '@2'"

#: admin.lua
msgid "Show protected areas of your nearby protectors"
msgstr "Mostra le aree protette dei protettori vicino a te"

#: admin.lua
msgid "Protector Names to remove: @1"
msgstr "Nomi dei protettori da eliminare: @1"

#: admin.lua
msgid "Name List Reset"
msgstr "Azzera l'elenco dei nomi"

#: doors_chest.lua
msgid "Protected Wooden Door"
msgstr "Porta di legno protetta"

#: doors_chest.lua
msgid "Protected Steel Door"
msgstr "Porta d'acciaio protetta"

#: doors_chest.lua
msgid "Protected Trapdoor"
msgstr "Botola protetta"

#: doors_chest.lua
msgid "Protected Steel Trapdoor"
msgstr "Botola d'acciaio protetta"

#: doors_chest.lua
msgid "Protected Chest"
msgstr "Baule protetto"

#: doors_chest.lua
msgid "To Chest"
msgstr "Al baule"

#: doors_chest.lua
msgid "To Inventory"
msgstr "All'inventario"

#: doors_chest.lua
msgid "Protected Chest (@1)"
msgstr "Baule protetto (@1)"

#: init.lua
msgid "-- Protector interface --"
msgstr "-- Interfaccia protettore --"

#: init.lua
msgid "PUNCH node to show protected area"
msgstr "COLPISCI il nodo per mostrare l'area protetta"

#: init.lua
msgid "USE for area check"
msgstr "USA per controllare l'area"

#: init.lua
msgid "Members:"
msgstr "Membri:"

#: init.lua
msgid "Close"
msgstr "Chiudi"

#: init.lua
msgid "Protection located at: @1"
msgstr "Protezione collocata a: @1"

#: init.lua
msgid "Members: @1."
msgstr "Membri: @1."

#: init.lua
msgid "This area is not protected."
msgstr "Quest'area non è protetta."

#: init.lua
msgid "You can build here."
msgstr "Qui puoi costruire."

#: init.lua tool.lua
msgid "Overlaps into above players protected area"
msgstr "Si sovrappone ad un'area sovrastante protetta dai giocatori"

#: init.lua
msgid "Protection Block"
msgstr "Blocco di protezione"

#: admin.lua init.lua tool.lua
msgid "Protection (owned by @1)"
msgstr "Protezione (di proprietà di @1)"

#: init.lua
msgid "Protection Logo"
msgstr "Logo di protezione"

#: init.lua
msgid "[MOD] Protector Redo loaded"
msgstr "[MOD] Protector Redo caricato"

#: init.lua
msgid "Spawn @1 has been protected up to a @2 block radius."
msgstr "Lo spawn @1 è stato protetto fino a un raggio di @2 blocchi."

#: init.lua
msgid "This area is owned by @1"
msgstr "Quest'area è di proprietà di @1"

#: pvp.lua
msgid "[Protector] on_punchplayer called with nil objects"
msgstr "[Protector] on_punchplayer chiamato con oggetti nil"

#: pvp.lua
msgid "[Protector] pvp_protect not active, update your version of Minetest"
msgstr "[Protector] pvp_protect non attiva, aggiorna la tua versione di Minetest"

#: pvp.lua
msgid "[Protector] pvp_protect is disabled"
msgstr "[Protector] pvp_protect è disattivato"

#: hud.lua
msgid "Owner: @1"
msgstr "Proprietario: @1"

#: tool.lua
msgid "Protector Placer Tool (stand near protector, face direction and use)"
msgstr "Strumento di posizionamento protettore (stai vicino al protettore, guarda la direzione e usa)"

#: tool.lua
msgid "Protector already in place!"
msgstr "Protettore già presente!"

#: tool.lua
msgid "No protectors available to place!"
msgstr "Nessun protettore disponibile da posizionare!"

#: tool.lua
msgid "Protector placed at @1"
msgstr "Protettore posizionato a @1"


code:
# textdomain: protector
# author: Xanthin and CodeXP
# last update: 2020/Jul/12

### admin.lua ###
Remove Protectors around players (separate names with spaces)=Entferne Störschützer von bestimmten Namen in der Nähe von Spielern (trenne Namen durch Leerzeichen)
<names list>=<Namensliste der Spieler>
Replace Protector Owner with name provided=Ersetze Besitzer der Störschützer mit neuem Besitzer
<owner name> <name to replace with>=<Name des Besitzers> <Name des neuen Besitzers>
Replacing Protector name '@1' with '@2'=Ersetze Besitzer der Störschützer von '@1' mit '@2'
Show protected areas of your nearby protectors=Zeige geschützte Bereiche der Störschützer in der Nähe
Protector Names to remove: @1=Störschutznamen zum Entfernen: @1
Name List Reset=Namensliste zurückgesetzt

### doors_chest.lua ###
Protected Wooden Door=Geschützte Holztür
Protected Steel Door=Geschützte Stahltür
Protected Trapdoor=Geschützte Falltür
Protected Steel Trapdoor=Geschützte Stahlfalltür
Protected Chest=Geschützte Truhe
To Chest=Zur Truhe
To Inventory=Zum Inventar
Protected Chest (@1)=Geschützte Truhe (@1)

### init.lua ###
-- Protector interface --=-- Störschutz-Interface --
PUNCH node to show protected area=SCHLAGE Node, um geschützten Bereich anzuzeigen oder
USE for area check=BENUTZE für Bereichsprüfung
Members:=Mitglieder:
Close=Schließen
Protection located at: @1=Störschutz befindet sich bei: @1
Members: @1.=Mitglieder: @1.
This area is not protected.=Dieser Bereich ist nicht geschützt.
You can build here.=Du kannst hier bauen.
Overlaps into above players protected area=Überlappung im geschützen Bereich eines Spielers
Protection Block=Störschutzblock
Protection (owned by @1)=Störschutz (gehört @1)
Protection Logo=Störschutzlogo
[MOD] Protector Redo loaded=[MOD] Protector Redo geladen
Spawn @1 has been protected up to a @2 block radius.=Spawn @1 ist geschützt mit einem Radius von @2 Blöcke.
This area is owned by @1=Dieser Bereich gehört @1

### pvp.lua ###
[Protector] on_punchplayer called with nil objects=on_punchplayer wurde durch \"nil objects\" aufgerufen
[Protector] pvp_protect not active, update your version of Minetest=pvp_protect ist nicht aktiv, aktualisiere deine Minetestversion
[Protector] pvp_protect is disabled=pvp_protect ist ausgeschaltet

### hud.lua ###
Owner: @1=Besitzer: @1

### tool.lua ###
Protector Placer Tool (stand near protector, face direction and use)=Störschutz Platzier-Werkzeug (stehe neben Störschutz, schaue in die gewünschte Richtung und anwenden)
Protector already in place!=Störschutz is bereits platziert!
No protectors available to place!=Keine Störschützer mehr im Inventar!
"Protector placed at @1"=Störschutz befindet sich bei: @1


code:
# textdomain: protector
# author: universales
# last update: 2020-02-27

### admin.lua ###
Remove Protectors around players (separate names with spaces)=Eliminar protectores alrededor de los jugadores (nombres separados con espacios)
<names list>=<Lista de nombres>
Replace Protector Owner with name provided=Reemplace el propietario del protector con el nombre proporcionado
<owner name> <name to replace with>=<Nombre del propietario> <Nombre del nuevo propietario>
Replacing Protector name '@1' with '@2'=Reemplazando el nombre del protector '@1' a '@2'
Show protected areas of your nearby protectors=Mostrar áreas protegidas de sus protectores cercanos
Protector Names to remove: @1=Nombres de protectores para eliminar: @1
Name List Reset=Restablecer lista de nombres

### doors_chest.lua ###
Protected Wooden Door=Puerta de madera protegida
Protected Steel Door=Puerta de hierro protegida
Protected Trapdoor=Trampilla Protegida
Protected Steel Trapdoor=Trampilla de hierro protegida
Protected Chest=Cofre protegido
To Chest=Al cofre
To Inventory=Al inventario
Protected Chest (@1)=Cofre protegido (@1)

### init.lua ###
-- Protector interface --=-- Interfaz del protector --
PUNCH node to show protected area=nodo de perforación para mostrar el área protegida
USE for area check=Usar para chequeo del área
Members:=Miembros:
Close=Cerrar
Protection located at: @1=Protección ubicada en: @1
Members: @1.=Miembros: @1.
This area is not protected.=Esta área no está protegida.
You can build here.=Puedes construir aquí.
Overlaps into above players protected area=Se superpone en el área protegida de los jugadores anteriores
Protection Block=Bloque de protección
Protection (owned by @1)=Protegido (Propiedad de @1)
Protection Logo=Logotipo de la protección
[MOD] Protector Redo loaded=[MOD] Protector recargado
Spawn @1 has been protected up to a @2 block radius.=Spawn @1 ha sido protegido hasta un radio de bloque @2.
This area is owned by @1=Esta área es propiedad de @1

### pvp.lua ###
[Protector] on_punchplayer called with nil objects=[Protector] on_punchplayer llamado con objetos nulos.
[Protector] pvp_protect not active, update your version of Minetest=[Protector] pvp_protect no está activo, actualiza tu versión de Minetest
[Protector] pvp_protect is disabled=[Protector] pvp_protect está deshabilitado

### hud.lua ###
Owner: @1=Propietario: @1

### tool.lua ###
Protector Placer Tool (stand near protector, face direction and use)=Herramienta de colocación del protector (pararse cerca del protector, dirección de la cara y uso)
Protector already in place!=¡El protector ya está en este lugar!
No protectors available to place!=¡No hay protectores disponibles para colocar!
Protector placed at @1=Protector colocado en @1


code:
# textdomain: protector
# author: CodeXP and TenPlus1
# last update: 2020/Jul/12

### admin.lua ###
Remove Protectors around players (separate names with spaces)=Retirer les protecteurs près des joueurs avec les noms fournis (noms séparés avec des espaces)
<names list>=<liste de noms>
Replace Protector Owner with name provided=Remplacer le propriétaire du protecteur par le nom fourni
<owner name> <name to replace with>=<nom du propriétaire> <nom à remplacer>
Replacing Protector name '@1' with '@2'=
Show protected areas of your nearby protectors=Affichez les zones protégées de vos protecteurs à proximité
Protector Names to remove: @1=Noms de protecteurs à supprimer: @1
Name List Reset=Liste de noms réinitialiser

### doors_chest.lua ###
Protected Wooden Door=Porte en bois protégée
Protected Steel Door=Porte en acier protégée
Protected Trapdoor=Trappe protégé
Protected Steel Trapdoor=Trap en acier protégé
Protected Chest=Coffre protégé
To Chest=Vers le coffre
To Inventory=Vers l'inventaire
Protected Chest (@1)=Coffre protégé (@1)

### init.lua ###
-- Protector interface --=-- Interface Protector --
PUNCH node to show protected area=TAPÉ le bloc pour afficher la zone protégée
USE for area check=UTILISER pour vérifier la zone
Members:=Membres:
Close=Fermer
Protection located at: @1=Protection située à: @1
Members: @1.=Membres: @1.
This area is not protected.=msgstr "Cette zone n'est pas protégée.
You can build here.=Vous pouvez construire ici.
Overlaps into above players protected area=Vous chevauché une zone protégé.
Protection Block=Bloc de protection
Protection (owned by @1)=Protection (détenue par @1)
Protection Logo=Logo de protection
[MOD] Protector Redo loaded=[MOD] Protector Redo chargé
Spawn @1 has been protected up to a @2 block radius.=
This area is owned by @1=Cette zone appartient à @1!

### pvp.lua ###
[Protector] on_punchplayer called with nil objects=[Protector] on_punchplayer appelé avec des objets nil
[Protector] pvp_protect not active, update your version of Minetest=[Protector] pvp_protect est désactivé, mettez à jour votre version de Minetest
[Protector] pvp_protect is disabled=[Protector] pvp_protect est désactivé

### hud.lua ###
Owner: @1=Propriétaire: @1

### tool.lua ###
Protector Placer Tool (stand near protector, face direction and use)=Outil de placement du protecteur (se tenir près du protecteur, direction du visage et utilisation)
Protector already in place!=Protecteur déjà en place!
No protectors available to place!=Aucun protecteur disponible à placer!
Protector placed at @1=Protection située à: @1


code:
# textdomain: protector
# author: Xanthin and CodeXP
# last update: 2018/Jul/10

### admin.lua ###
Remove Protectors around players (separate names with spaces)=Elimina i protettori attorno ai giocatori (separa i nomi con gli spazi)
<names list>=<elenco nomi>
Replace Protector Owner with name provided=Sostituisci il proprietario del protettore col nome fornito
<owner name> <name to replace with>=<nome proprietario> <nome con cui sostituirlo>
Replacing Protector name '@1' with '@2'=Sostituzione del nome del protettore '@1' con '@2'
Show protected areas of your nearby protectors=Mostra le aree protette dei protettori vicino a te
Protector Names to remove: @1=Nomi dei protettori da eliminare: @1
Name List Reset=Azzera l'elenco dei nomi

### doors_chest.lua ###
Protected Wooden Door=Porta di legno protetta
Protected Steel Door=Porta d'acciaio protetta
Protected Trapdoor=Botola protetta
Protected Steel Trapdoor=Botola d'acciaio protetta
Protected Chest=Baule protetto
To Chest=Al baule
To Inventory=All'inventario
Protected Chest (@1)=Baule protetto (@1)

### init.lua ###
-- Protector interface --=-- Interfaccia protettore --
PUNCH node to show protected area=COLPISCI il nodo per mostrare l'area protetta
USE for area check=USA per controllare l'area
Members:=Membri:
Close=Chiudi
Protection located at: @1=Protezione collocata a: @1
Members: @1.=Membri: @1.
This area is not protected.=Quest'area non è protetta.
You can build here.=Qui puoi costruire.
Overlaps into above players protected area=Si sovrappone ad un'area sovrastante protetta dai giocatori
Protection Block=Blocco di protezione
Protection (owned by @1)=Protezione (di proprietà di @1)
Protection Logo=Logo di protezione
[MOD] Protector Redo loaded=[MOD] Protector Redo caricato
Spawn @1 has been protected up to a @2 block radius.=Lo spawn @1 è stato protetto fino a un raggio di @2 blocchi.
This area is owned by @1=Quest'area è di proprietà di @1

### pvp.lua ###
[Protector] on_punchplayer called with nil objects=[Protector] on_punchplayer chiamato con oggetti nil
[Protector] pvp_protect not active, update your version of Minetest=[Protector] pvp_protect non attiva, aggiorna la tua versione di Minetest
[Protector] pvp_protect is disabled=[Protector] pvp_protect è disattivato

### hud.lua ###
Owner: @1=Proprietario: @1

### tool.lua ###
Protector Placer Tool (stand near protector, face direction and use)=Strumento di posizionamento protettore (stai vicino al protettore, guarda la direzione e usa)
Protector already in place!=Protettore già presente!
No protectors available to place!=Nessun protettore disponibile da posizionare!
Protector placed at @1=Protettore posizionato a @1


code:
# textdomain: protector
# author: CodeXP
# last update: 2018/Jul/10

### admin.lua ###
Remove Protectors around players (separate names with spaces)=Удалить защиту рядом с игроками (перечислить имена, разделяя пробелами)
<names list>=<список имён>
Replace Protector Owner with name provided=Заменить владельца защиты новым владельцем
<owner name> <name to replace with>=<имя владельца> <имя нового владельца>
Replacing Protector name '@1' with '@2'=Заменяется владелец защиты с '@1' на '@2'
Show protected areas of your nearby protectors=Показать защищенные территории с ближней защитой
Protector Names to remove: @1=Имена защит, подлежащих удалению: @1
Name List Reset=Сброс списка имен

### doors_chest.lua ###
Protected Wooden Door=Защищенная яблоневая дверь
Protected Steel Door=Защищенная стальная дверь
Protected Trapdoor=Защищенный яблоневый люк
Protected Steel Trapdoor=Защищенный стальной люк
Protected Chest=Защищенный сундук
To Chest=В сундук
To Inventory=В инвентрарь
Protected Chest (@1)=Защищенный сундук (@1)

### init.lua ###
-- Protector interface --=-- Настройка защиты --
PUNCH node to show protected area=СТУКНУТЬ узел для подсведки защищенной территории
USE for area check=ЛКМ для проверки защищенной территории
Members:=Участники:
Close=Закрыть
Protection located at: @1=Защита находится на координатах @1
Members: @1.=Участники: @1.
This area is not protected.=Территория свободна.
You can build here.=Здесь можно ставить блоки."
Overlaps into above players protected area=Защитный блок не может быть установлен: пересечение с областями, защищенными другими игроками
Protection Block=Защитный блок
Protection (owned by @1)=Защита игрока @1
Protection Logo=Защитный знак
[MOD] Protector Redo loaded=[MOD] Модификация \"Переделанная Защита\" загружена
Spawn @1 has been protected up to a @2 block radius.=Спаун @1 защищен в радиусе @2 блока.
This area is owned by @1=Эта территория пренадлежит @1

### pvp.lua ###
[Protector] on_punchplayer called with nil objects=[Защита] on_punchplayer вызвана с нулевыми объектами
[Protector] pvp_protect not active, update your version of Minetest=[Защита] pvp_protect не активен, обновите версию Minetest
[Protector] pvp_protect is disabled=[Защита] pvp_protect отключен

### hud.lua ###
Owner: @1=Владелец: @1

### tool.lua ###
Protector Placer Tool (stand near protector, face direction and use)=Инструмент установки защиты (станьте рядом с защитой, повернитесь в нужное направление и используйте)
Protector already in place!=Защита уже установлена!
No protectors available to place!=У вас нет защитных блоков в инвентаре!
Protector placed at @1=Защита находится на координатах @1


code:
# textdomain: protector
# author: CodeXP and TenPlus1
# last update: 2020/Jul/12

### admin.lua ###
Remove Protectors around players (separate names with spaces)=Ismi verilen oyuncuların yanındaki korumaları kaldır. (İsimleri boşlukla ayır)
<names list>=<isim listesi>
Replace Protector Owner with name provided=Koruyucu Sahibini belirtilen adla değiştirin
<owner name> <name to replace with>=<sahip adı> <değiştirilecek ad>
Replacing Protector name '@1' with '@2'='@ 1' Koruyucu adını '@ 2' ile değiştirin
Show protected areas of your nearby protectors=Yakındaki koruyucuların korunan alanlarını göster
Protector Names to remove: @1=Silinecek korumaların isimleri: @1
Name List Reset=İsim listesini sıfırla

### doors_chest.lua ###
Protected Wooden Door=Korumalı ahşap kapı
Protected Steel Door=Korumalı çelik kapı
Protected Trapdoor=Korumalı tuzak kapısı
Protected Steel Trapdoor=Korumalı çelik tuzak kapısı
Protected Chest=Korumalı sandık
To Chest=Sandığa
To Inventory=Envantere
Protected Chest (@1)=Korumalı sandık (@1)

### init.lua ###
-- Protector interface --=-- Koruyucu arayüz --
PUNCH node to show protected area=Korunan alanı göstermek için yumruk
USE for area check=Bölge kontrolü için kullan
Members:=Üyeler
Close=Kapat
Protection located at: @1=Korumanın bulunduğu yer  @1
Members: @1.=Üyeler  @1.
This area is not protected.=Bu alan korumalı değildir.
You can build here.=Buraya inşaa edebilirsiniz.
Overlaps into above players protected area=Yukarıdaki oyuncuların koruma alanı ile çakışıyor
Protection Block=Koruma kutusu
Protection (owned by @1)=Koruma (@1 sahibidir)
Protection Logo=Koruma arması
[MOD] Protector Redo loaded=[MOD] Protector Redo yüklendi
Spawn @1 has been protected up to a @2 block radius.=Spawn @1, @2 blok yarıçapa kadar korunur.
This area is owned by @1=Burasının sahibi @1!

### pvp.lua ###
[Protector] on_punchplayer called with nil objects=[Protector] on_punchplayer boş objelerle çağrıldı
[Protector] pvp_protect not active, update your version of Minetest=[Protector] pvp_protect aktif değil, Minetest sürümünüzü güncelleyin.
[Protector] pvp_protect is disabled=[Protector] pvp_protect kapatıldı.

### hud.lua ###
Owner: @1=Sahip: @1

### tool.lua ###
Protector Placer Tool (stand near protector, face direction and use)=Koruyucu Yerleştirme Aleti (koruyucunun yanında durun, yüz yönü ve kullanım)
Protector already in place!=Koruyucu zaten yerinde!
No protectors available to place!=Yerleştirilecek koruyucu yok!
Protector placed at @1=Korumanın bulunduğu yer @1


code:
# Russian translation for PROTECTOR MOD.
# Copyright (C) 2018 TenPlus1
# This file is distributed under the same license as the PROTECTOR MOD package.
# Doloment, 2017.
# CodeXP <codexp@gmx.net>, 2018.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PROTECTOR MOD\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-10 17:33+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: CodeXP <codexp@gmx.net>\n"
"Language-Team: \n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: admin.lua
msgid "Remove Protectors around players (separate names with spaces)"
msgstr "Удалить защиту рядом с игроками (перечислить имена, разделяя пробелами)"

#: admin.lua
msgid "<names list>"
msgstr "<список имён>"

#: admin.lua
msgid "Replace Protector Owner with name provided"
msgstr "Заменить владельца защиты новым владельцем"

#: admin.lua
msgid "<owner name> <name to replace with>"
msgstr "<имя владельца> <имя нового владельца>"

#: admin.lua
msgid "Replacing Protector name '@1' with '@2'"
msgstr "Заменяется владелец защиты с '@1' на '@2'"

#: admin.lua
msgid "Show protected areas of your nearby protectors"
msgstr "Показать защищенные территории с ближней защитой"

#: admin.lua
msgid "Protector Names to remove: @1"
msgstr "Имена защит, подлежащих удалению: @1"

#: admin.lua
msgid "Name List Reset"
msgstr "Сброс списка имен"

#: doors_chest.lua
msgid "Protected Wooden Door"
msgstr "Защищенная яблоневая дверь"

#: doors_chest.lua
msgid "Protected Steel Door"
msgstr "Защищенная стальная дверь"

#: doors_chest.lua
msgid "Protected Trapdoor"
msgstr "Защищенный яблоневый люк"

#: doors_chest.lua
msgid "Protected Steel Trapdoor"
msgstr "Защищенный стальной люк"

#: doors_chest.lua
msgid "Protected Chest"
msgstr "Защищенный сундук"

#: doors_chest.lua
msgid "To Chest"
msgstr "В сундук"

#: doors_chest.lua
msgid "To Inventory"
msgstr "В инвентрарь"

#: doors_chest.lua
msgid "Protected Chest (@1)"
msgstr "Защищенный сундук (@1)"

#: init.lua
msgid "-- Protector interface --"
msgstr "-- Настройка защиты --"

#: init.lua
msgid "PUNCH node to show protected area"
msgstr "СТУКНУТЬ узел для подсведки защищенной территории"

#: init.lua
msgid "USE for area check"
msgstr "ЛКМ для проверки защищенной территории"

#: init.lua
msgid "Members:"
msgstr "Участники:"

#: init.lua
msgid "Close"
msgstr "Закрыть"

#: init.lua
msgid "Protection located at: @1"
msgstr "Защита находится на координатах @1"

#: init.lua
msgid "Members: @1."
msgstr "Участники: @1."

#: init.lua
msgid "This area is not protected."
msgstr "Территория свободна."

#: init.lua
msgid "You can build here."
msgstr "Здесь можно ставить блоки."

#: init.lua tool.lua
msgid "Overlaps into above players protected area"
msgstr ""
"Защитный блок не может быть установлен: пересечение с областями, защищенными "
"другими игроками"

#: init.lua
msgid "Protection Block"
msgstr "Защитный блок"

#: admin.lua init.lua tool.lua
msgid "Protection (owned by @1)"
msgstr "Защита игрока @1"

#: init.lua
msgid "Protection Logo"
msgstr "Защитный знак"

#: init.lua
msgid "[MOD] Protector Redo loaded"
msgstr "[MOD] Модификация \"Переделанная Защита\" загружена"

#: init.lua
msgid "Spawn @1 has been protected up to a @2 block radius."
msgstr "Спаун @1 защищен в радиусе @2 блока."

#: init.lua
msgid "This area is owned by @1"
msgstr "Эта территория пренадлежит @1"

#: pvp.lua
msgid "[Protector] on_punchplayer called with nil objects"
msgstr "[Защита] on_punchplayer вызвана с нулевыми объектами"

#: pvp.lua
msgid "[Protector] pvp_protect not active, update your version of Minetest"
msgstr "[Защита] pvp_protect не активен, обновите версию Minetest"

#: pvp.lua
msgid "[Protector] pvp_protect is disabled"
msgstr "[Защита] pvp_protect отключен"

#: hud.lua
msgid "Owner: @1"
msgstr "Владелец: @1"

#: tool.lua
msgid "Protector Placer Tool (stand near protector, face direction and use)"
msgstr ""
"Инструмент установки защиты (станьте рядом с защитой, повернитесь в нужное "
"направление и используйте)"

#: tool.lua
msgid "Protector already in place!"
msgstr "Защита уже установлена!"

#: tool.lua
msgid "No protectors available to place!"
msgstr "У вас нет защитных блоков в инвентаре!"

#: tool.lua
msgid "Protector placed at @1"
msgstr "Защита находится на координатах @1"


code:
# Template for PROTECTOR MOD.
# Copyright (C) 2018 TenPlus1
# This file is distributed under the same license as the PROTECTOR MOD package.
# Xanthin <xanthin@wiuwiu.de>, 2016.
# CodeXP <codexp@gmx.net>, 2018.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PROTECTOR MOD\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-10 17:33+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: CodeXP <codexp@gmx.net>\n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: admin.lua
msgid "Remove Protectors around players (separate names with spaces)"
msgstr ""

#: admin.lua
msgid "<names list>"
msgstr ""

#: admin.lua
msgid "Replace Protector Owner with name provided"
msgstr ""

#: admin.lua
msgid "<owner name> <name to replace with>"
msgstr ""

#: admin.lua
msgid "Replacing Protector name '@1' with '@2'"
msgstr ""

#: admin.lua
msgid "Show protected areas of your nearby protectors"
msgstr ""

#: admin.lua
msgid "Protector Names to remove: @1"
msgstr ""

#: admin.lua
msgid "Name List Reset"
msgstr ""

#: doors_chest.lua
msgid "Protected Wooden Door"
msgstr ""

#: doors_chest.lua
msgid "Protected Steel Door"
msgstr ""

#: doors_chest.lua
msgid "Protected Trapdoor"
msgstr ""

#: doors_chest.lua
msgid "Protected Steel Trapdoor"
msgstr ""

#: doors_chest.lua
msgid "Protected Chest"
msgstr ""

#: doors_chest.lua
msgid "To Chest"
msgstr ""

#: doors_chest.lua
msgid "To Inventory"
msgstr ""

#: doors_chest.lua
msgid "Protected Chest (@1)"
msgstr ""

#: init.lua
msgid "-- Protector interface --"
msgstr ""

#: init.lua
msgid "PUNCH node to show protected area"
msgstr ""

#: init.lua
msgid "USE for area check"
msgstr ""

#: init.lua
msgid "Members:"
msgstr ""

#: init.lua
msgid "Close"
msgstr ""

#: init.lua
msgid "Protection located at: @1"
msgstr ""

#: init.lua
msgid "Members: @1."
msgstr ""

#: init.lua
msgid "This area is not protected."
msgstr ""

#: init.lua
msgid "You can build here."
msgstr ""

#: init.lua tool.lua
msgid "Overlaps into above players protected area"
msgstr ""

#: init.lua
msgid "Protection Block"
msgstr ""

#: admin.lua init.lua tool.lua
msgid "Protection (owned by @1)"
msgstr ""

#: init.lua
msgid "Protection Logo"
msgstr ""

#: init.lua
msgid "[MOD] Protector Redo loaded"
msgstr ""

#: init.lua
msgid "Spawn @1 has been protected up to a @2 block radius."
msgstr ""

#: init.lua
msgid "This area is owned by @1"
msgstr ""

#: pvp.lua
msgid "[Protector] on_punchplayer called with nil objects"
msgstr ""

#: pvp.lua
msgid "[Protector] pvp_protect not active, update your version of Minetest"
msgstr ""

#: pvp.lua
msgid "[Protector] pvp_protect is disabled"
msgstr ""

#: hud.lua
msgid "Owner: @1"
msgstr ""

#: tool.lua
msgid "Protector Placer Tool (stand near protector, face direction and use)"
msgstr ""

#: tool.lua
msgid "Protector already in place!"
msgstr ""

#: tool.lua
msgid "No protectors available to place!"
msgstr ""

#: tool.lua
msgid "Protector placed at @1"
msgstr ""


code:
# Turkish translation for PROTECTOR MOD.
# Copyright (C) 2018 TenPlus1
# This file is distributed under the same license as the PROTECTOR MOD package.
# mahmutelmas06, 2016.
# CodeXP <codexp@gmx.net>, 2018.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PROTECTOR MOD\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-10 17:33+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: CodeXP <codexp@gmx.net>\n"
"Language-Team: \n"
"Language: tr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: admin.lua
msgid "Remove Protectors around players (separate names with spaces)"
msgstr "Ismi verilen oyuncuların yanındaki korumaları kaldır. (İsimleri boşlukla "
"ayır)"

#: admin.lua
msgid "<names list>"
msgstr ""

#: admin.lua
msgid "Replace Protector Owner with name provided"
msgstr ""

#: admin.lua
msgid "<owner name> <name to replace with>"
msgstr ""

#: admin.lua
msgid "Replacing Protector name '@1' with '@2'"
msgstr ""

#: admin.lua
msgid "Show protected areas of your nearby protectors"
msgstr ""

#: admin.lua
msgid "Protector Names to remove: @1"
msgstr "Silinecek korumaların isimleri: @1"

#: admin.lua
msgid "Name List Reset"
msgstr "İsim listesini sıfırla"

#: doors_chest.lua
msgid "Protected Wooden Door"
msgstr "Korumalı ahşap kapı"

#: doors_chest.lua
msgid "Protected Steel Door"
msgstr "Korumalı çelik kapı"

#: doors_chest.lua
msgid "Protected Trapdoor"
msgstr "Korumalı tuzak kapısı"

#: doors_chest.lua
msgid "Protected Steel Trapdoor"
msgstr "Korumalı çelik tuzak kapısı"

#: doors_chest.lua
msgid "Protected Chest"
msgstr "Korumalı sandık"

#: doors_chest.lua
msgid "To Chest"
msgstr "Sandığa"

#: doors_chest.lua
msgid "To Inventory"
msgstr "Envantere"

#: doors_chest.lua
msgid "Protected Chest (@1)"
msgstr "Korumalı sandık (@1)"

#: init.lua
msgid "-- Protector interface --"
msgstr ""

#: init.lua
msgid "PUNCH node to show protected area"
msgstr "Korunan alanı göstermek için yumruk"

#: init.lua
msgid "USE for area check"
msgstr "Bölge kontrolü için kullan"

#: init.lua
msgid "Members:"
msgstr "Üyeler"

#: init.lua
msgid "Close"
msgstr "Kapat"

#: init.lua
msgid "Protection located at: @1"
msgstr "Korumanın bulunduğu yer  @1"

#: init.lua
msgid "Members: @1."
msgstr "Üyeler  @1."

#: init.lua
msgid "This area is not protected."
msgstr "Bu alan korumalı değildir."

#: init.lua
msgid "You can build here."
msgstr "Buraya inşaa edebilirsiniz."

#: init.lua tool.lua
msgid "Overlaps into above players protected area"
msgstr ""

#: init.lua
msgid "Protection Block"
msgstr "Koruma kutusu"

#: admin.lua init.lua tool.lua
msgid "Protection (owned by @1)"
msgstr "Koruma (@1 sahibidir)"

#: init.lua
msgid "Protection Logo"
msgstr "Koruma arması"

#: init.lua
msgid "[MOD] Protector Redo loaded"
msgstr "[MOD] Protector Redo yüklendi"

#: init.lua
msgid "Spawn @1 has been protected up to a @2 block radius."
msgstr ""

#: init.lua
msgid "This area is owned by @1"
msgstr "Burasının sahibi @1!"

#: pvp.lua
msgid "[Protector] on_punchplayer called with nil objects"
msgstr "[Protector] on_punchplayer boş objelerle çağrıldı"

#: pvp.lua
msgid "[Protector] pvp_protect not active, update your version of Minetest"
msgstr "[Protector] pvp_protect aktif değil, Minetest sürümünüzü güncelleyin."

#: pvp.lua
msgid "[Protector] pvp_protect is disabled"
msgstr "[Protector] pvp_protect kapatıldı."

#: hud.lua
msgid "Owner: @1"
msgstr ""

#: tool.lua
msgid "Protector Placer Tool (stand near protector, face direction and use)"
msgstr ""

#: tool.lua
msgid "Protector already in place!"
msgstr ""

#: tool.lua
msgid "No protectors available to place!"
msgstr ""

#: tool.lua
msgid "Protector placed at @1"
msgstr "Korumanın bulunduğu yer @1"


code:
-- add lucky blocks

if minetest.get_modpath("lucky_block") then

	lucky_block:add_blocks({
		{"dro", {"protector:protect"}, 3},
		{"dro", {"protector:protect2"}, 3},
		{"dro", {"protector:door_wood"}, 1},
		{"dro", {"protector:door_steel"}, 1},
		{"exp", 5, true},
		{"dro", {"protector:trapdoor"}, 1},
		{"dro", {"protector:trapdoor_steel"}, 1},
		{"dro", {"protector:tool"}, 1},
		{"dro", {"protector:chest"}, 1},
		{"exp"},
	})
end


code:
name = protector
description = Lets players craft special blocks to protect their builds or disable PVP in areas.
optional_depends = default, intllib, lucky_block, mesecons_mvps, playerfactions


code:
local S = protector.intllib

-- get static spawn position
local statspawn = minetest.string_to_pos(minetest.settings:get("static_spawnpoint"))
		or {x = 0, y = 2, z = 0}

-- is spawn protected
local protector_spawn = tonumber(minetest.settings:get("protector_spawn")
	or minetest.settings:get("protector_pvp_spawn")) or 0

-- is night-only pvp enabled
local protector_night_pvp = minetest.settings:get_bool("protector_night_pvp")

-- disables PVP in your own protected areas
if minetest.settings:get_bool("enable_pvp")
and minetest.settings:get_bool("protector_pvp") then

	if minetest.register_on_punchplayer then

		minetest.register_on_punchplayer(function(player, hitter,
				time_from_last_punch, tool_capabilities, dir, damage)

			if not player
			or not hitter then
				print(S("[Protector] on_punchplayer called with nil objects"))
			end

			if not hitter:is_player() then
				return false
			end

			-- no pvp at spawn area
			local pos = player:get_pos()

			if pos.x < statspawn.x + protector_spawn
			and pos.x > statspawn.x - protector_spawn
			and pos.y < statspawn.y + protector_spawn
			and pos.y > statspawn.y - protector_spawn
			and pos.z < statspawn.z + protector_spawn
			and pos.z > statspawn.z - protector_spawn then
				return true
			end

			-- do we enable pvp at night time only ?
			if protector_night_pvp then

				-- get time of day
				local tod = minetest.get_timeofday() or 0

				if tod > 0.2 and tod < 0.8 then
					--
				else
					return false
				end
			end

			-- is player being punched inside a protected area ?
			if minetest.is_protected(pos, hitter:get_player_name()) then
				return true
			end

			return false

		end)
	else
		print(S("[Protector] pvp_protect not active, update your version of Minetest"))

	end
else
	print(S("[Protector] pvp_protect is disabled"))
end


code:
#    Size of protected area around protection node limiting player interaction
protector_radius (Protector Radius) int 5

#    Flips player around when accessing protected area to stop lag griefing
protector_flip (Protector Flip) bool false

#    Hurts player by amount entered when accessing protected area, 0 to disable
protector_hurt (Protector Hurt) int 0

#    Sets a protected area around spawn by node radius given
protector_spawn (Protector Spawn) int 0

#    Enables PVP inside of protected areas
protector_pvp (Protector PVP) bool false

#    When true will allow PVP inside protected spawn area
protector_pvp_spawn (Protector PVP Spawn) int 0

#    When true will allow PVP inside all protected areas at night time only
protector_night_pvp (Protector Night PVP) bool false

#    Interval in seconds that protection field is shown
protector_show_interval (Protector Show Interval) int 5

#    Interval in seconds that HUD ownership text is updated, 0 to disable
protector_hud_interval (Protector HUD Interval) int 5

#    Enables craft recipe for protection block
protector_recipe (Enable Protector recipe) bool true

#    Enables protection messages in player chat
protector_msg (Enable Protector Messages) bool true


code:
-- protector placement tool (thanks to Shara for code and idea)

local S = protector.intllib

-- get protection radius
local r = tonumber(minetest.settings:get("protector_radius")) or 5

minetest.register_craftitem("protector:tool", {
	description = S("Protector Placer Tool (stand near protector, face direction and use)"),
	inventory_image = "protector_display.png^protector_logo.png",
	stack_max = 1,

	on_use = function(itemstack, user, pointed_thing)

		local name = user:get_player_name()

		-- check for protector near player (2 block radius)
		local pos = user:get_pos()
		local pp = minetest.find_nodes_in_area(
			vector.subtract(pos, 2), vector.add(pos, 2),
			{"protector:protect", "protector:protect2", "protector:protect_hidden"})

		if #pp == 0 then return end -- none found

		pos = pp[1] -- take position of first protector found

		-- get members on protector
		local meta = minetest.get_meta(pos)
		local members = meta:get_string("members") or ""

		-- get direction player is facing
		local dir = minetest.dir_to_facedir( user:get_look_dir() )
		local vec = {x = 0, y = 0, z = 0}
		local gap = (r * 2) + 1
		local pit =  user:get_look_vertical()

		-- set placement coords
		if pit > 1.2 then
			vec.y = -gap -- up
		elseif pit < -1.2 then
			vec.y = gap -- down
		elseif dir == 0 then
			vec.z = gap -- north
		elseif dir == 1 then
			vec.x = gap -- east
		elseif dir == 2 then
			vec.z = -gap -- south
		elseif dir == 3 then
			vec.x = -gap -- west
		end

		-- new position
		pos.x = pos.x + vec.x
		pos.y = pos.y + vec.y
		pos.z = pos.z + vec.z

		-- does placing a protector overlap existing area
		if not protector.can_dig(r * 2, pos, user:get_player_name(), true, 3) then

			minetest.chat_send_player(name,
				S("Overlaps into above players protected area"))

			return
		end

		-- does a protector already exist ?
		if #minetest.find_nodes_in_area(
			vector.subtract(pos, 1), vector.add(pos, 1),
			{"protector:protect", "protector:protect2",
					"protector:protect_hidden"}) > 0 then

			minetest.chat_send_player(name, S("Protector already in place!"))

			return
		end

		-- do we have protectors to use ?
		local nod
		local inv = user:get_inventory()

		if not inv:contains_item("main", "protector:protect")
		and not inv:contains_item("main", "protector:protect2") then

			minetest.chat_send_player(name,
				S("No protectors available to place!"))

			return
		end

		-- take protector (block first then logo)
		if inv:contains_item("main", "protector:protect") then

			inv:remove_item("main", "protector:protect")

			nod = "protector:protect"

		elseif inv:contains_item("main", "protector:protect2") then

			inv:remove_item("main", "protector:protect2")

			nod = "protector:protect2"
		end

		-- do not replace containers with inventory space
		local inv = minetest.get_inventory({type = "node", pos = pos})

		if inv then
			minetest.chat_send_player(name,
				S("Cannot place protector, container at") ..
					" " .. minetest.pos_to_string(pos))
			return
		end

		-- protection check for other mods like Areas
		if minetest.is_protected(pos, name) then
			minetest.chat_send_player(name,
				S("Cannot place protector, already protected at") ..
				" " .. minetest.pos_to_string(pos))
			return
		end

		-- place protector
		minetest.set_node(pos, {name = nod, param2 = 1})

		-- set protector metadata
		local meta = minetest.get_meta(pos)

		meta:set_string("owner", name)
		meta:set_string("infotext", "Protection (owned by " .. name .. ")")

		-- copy members across if holding sneak when using tool
		if user:get_player_control().sneak then
			meta:set_string("members", members)
		else
			meta:set_string("members", "")
		end

		minetest.chat_send_player(name,
				S("Protector placed at") ..
				" " ..  minetest.pos_to_string(pos))

	end,
})

-- tool recipe
local df = "default:steel_ingot"

if not minetest.registered_items[df] then
	df = "mcl_core:iron_ingot"
end

minetest.register_craft({
	output = "protector:tool",
	recipe = {
		{df, df, df},
		{df, "protector:protect", df},
		{df, df, df},
	}
})


code:
# Simple Fileshare

A very simple -- and insecure -- CGI script for sharing files via links.

The script allows anyone with access to upload any file. The following security measures should be implemented before releasing this into the wild:

* Limit access to this script to only people you trust.
* Set a size limit for uploads in your web server config.
* Implement some sort of control mechanism to ensure that your disk does not fill up with files. A cron job that removes old files, or even an isolated partition where the files live.
* If you follow the installation instructions below then make sure nobody can access the .git directory.

## Installation

Clone this repository into the folder you wish to have it. Take note of the security considerations above and implement necessary mitigations.

Check out a local branch:
`git checkout -b local`

Change the `FILES_DIR_URL = "https://yourdomainhere/simple-fileshare/files"` to something suitable for your site.

## Upgrade

I gotta say I don't believe there will be any, but still.

```
git checkout master
git pull
git checkout -
git rebase master
```

That should be it.

repo_name: tinyrabbit/simple


code:
#!/bin/bash

ls | grep -vE 'clean\.sh|index\.html' | xargs rm -f


code:
<!DOCTYPE HTML>
<html></html>


code:
#!/usr/bin/env python3
# vim: tabstop=4 shiftwidth=4 expandtab

import cgi, os, re, string, random
import cgitb

FILES_DIR_URL = "https://yourdomainhere/simple-fileshare/files"

cgitb.enable(display=0, logdir=".")

form = cgi.FieldStorage()

filename = ''
fullFilename = ''
filenameOutput = ''
copyButton = ''
try:
    # A nested FieldStorage instance holds the file
    fileitem = form['file']

    # Test if the file was uploaded
    if fileitem.filename:

        filetype = os.path.basename(fileitem.filename).split('.')[-1]
        if filetype: # sanitize
            filetype = ''.join(re.findall('[a-zA-Z0-9]',filetype))
            # Generate a random 16 char filename, to avoid directory traversal and whatnot
            filename = ''.join(random.choice(string.ascii_letters + string.digits) for x in range(16)) + f".{filetype}"
            open(f"files/{filename}", 'wb').write(fileitem.file.read())

        if filename:
            fullFilename = f"{FILES_DIR_URL}/{filename}"
            filenameOutput = f"
<input type='text' value='{fullFilename}' readonly style='width: 100%'>
"
            copyButton = "<button onclick=\"copyLinkToClipboard()\">Copy link</button>"
except:
    # We don't really want to do anything here...
    someVar = 0

print("""Content-Type: text/html

<!DOCTYPE html>

        <title>Simple Filesharing</title>

		<meta charset='utf-8'>
		<meta name='viewport' content='width=device-width,initial-scale=1'>

        <form enctype="multipart/form-data" action="index.cgi" method="post">

File: <input type="file" name="file"><input type="submit" value="Upload">

            %s
        </form>
            %s

""" % (fullFilename,filenameOutput,copyButton))


code:
# ---> Archives
# It's better to unpack these files and commit the raw source because
# git has its own built in compression methods.
*.7z
*.jar
*.rar
*.zip
*.gz
*.bzip
*.bz2
*.xz
*.lzma
*.cab

#packing-only formats
*.iso
*.tar

#package management formats
*.dmg
*.xpi
*.gem
*.egg
*.deb
*.rpm
*.msi
*.msm
*.msp

repo_name: pekwm/themes

path: .gitignore