Initial commit

This commit is contained in:
2026-07-07 13:12:56 -04:00
parent cfbf56ef38
commit 31f92fba9c
21 changed files with 3009 additions and 2988 deletions
+152 -152
View File
@@ -1,152 +1,152 @@
Protector Redo mod [protect] Protector Redo mod [protect]
Protector redo for minetest is a mod that protects a players builds by placing Protector redo for minetest is a mod that protects a players builds by placing
a block that stops other players from digging or placing blocks in that area. a block that stops other players from digging or placing blocks in that area.
based on glomie's mod, remade by Zeg9 and rewritten by TenPlus1. based on glomie's mod, remade by Zeg9 and rewritten by TenPlus1.
https://forum.minetest.net/viewtopic.php?f=11&t=9376 https://forum.minetest.net/viewtopic.php?f=11&t=9376
Change log: Change log:
- 0.1 - Initial release - 0.1 - Initial release
- 0.2 - Texture update - 0.2 - Texture update
- 0.3 - Added Protection Logo to blend in with player builds - 0.3 - Added Protection Logo to blend in with player builds
- 0.4 - Code tweak for 0.4.10+ - 0.4 - Code tweak for 0.4.10+
- 0.5 - Added protector.radius variable in init.lua (default: 5) - 0.5 - Added protector.radius variable in init.lua (default: 5)
- 0.6 - Added Protected Doors (wood and steel) and Protected Chest - 0.6 - Added Protected Doors (wood and steel) and Protected Chest
- 0.7 - Protected Chests now have "To Chest" and "To Inventory" buttons to copy - 0.7 - Protected Chests now have "To Chest" and "To Inventory" buttons to copy
contents across, also chests can be named contents across, also chests can be named
- 0.8 - Updated to work with Minetest 0.4.12, simplified textures - 0.8 - Updated to work with Minetest 0.4.12, simplified textures
- 0.9 - Tweaked code - 0.9 - Tweaked code
- 1.0 - Only owner can remove protector - 1.0 - Only owner can remove protector
- 1.1 - Set 'protector_pvp = true' in minetest.conf to disable pvp in protected - 1.1 - Set 'protector_pvp = true' in minetest.conf to disable pvp in protected
areas except your own, also setting protector_pvp_spawn higher than 0 will areas except your own, also setting protector_pvp_spawn higher than 0 will
disable pvp around spawn area with the radius you entered disable pvp around spawn area with the radius you entered
- 1.2 - Shift and click support added with Minetest 0.4.13 to quickly copy stacks - 1.2 - Shift and click support added with Minetest 0.4.13 to quickly copy stacks
to and from protected chest to and from protected chest
- 1.3 - Moved protector on_place into node itself, protector zone display changed - 1.3 - Moved protector on_place into node itself, protector zone display changed
from 10 to 5 seconds, general code tidy from 10 to 5 seconds, general code tidy
- 1.4 - Changed protector recipes to give single item instead of 4, added + button - 1.4 - Changed protector recipes to give single item instead of 4, added + button
to interface, tweaked and tidied code, added admin command /delprot to remove to interface, tweaked and tidied code, added admin command /delprot to remove
protectors in bulk from banned/old players protectors in bulk from banned/old players
- 1.5 - Added much requested protected trapdoor - 1.5 - Added much requested protected trapdoor
- 1.6 - Added protector_drop (true or false) and protector_hurt (hurt by this num) - 1.6 - Added protector_drop (true or false) and protector_hurt (hurt by this num)
variables to minetest.conf settings to stop players breaking protected variables to minetest.conf settings to stop players breaking protected
areas by dropping tools and hurting player. areas by dropping tools and hurting player.
- 1.7 - Included an edited version of WTFPL doors mod since protected doors didn't - 1.7 - Included an edited version of WTFPL doors mod since protected doors didn't
work with the doors mod in the latest daily build... Now it's fine :) work with the doors mod in the latest daily build... Now it's fine :)
added support for "protection_bypass" privelage. added support for "protection_bypass" privelage.
- 1.8 - Added 'protector_flip' setting to stop players using lag to grief into - 1.8 - Added 'protector_flip' setting to stop players using lag to grief into
another players house, it flips them around to stop them digging. another players house, it flips them around to stop them digging.
- 1.9 - Renamed 'protector_pvp_spawn' setting to 'protector_spawn' which protects - 1.9 - Renamed 'protector_pvp_spawn' setting to 'protector_spawn' which protects
an area around static spawnpoint and disables pvp if active. an area around static spawnpoint and disables pvp if active.
(note: previous name can still be used) (note: previous name can still be used)
- 2.0 - Added protector placement tool (thanks to Shara) so that players can easily - 2.0 - Added protector placement tool (thanks to Shara) so that players can easily
stand on a protector, face in a direction and it places a new one at a set stand on a protector, face in a direction and it places a new one at a set
distance to cover protection radius. Added /protector_show command (thanks agaran) distance to cover protection radius. Added /protector_show command (thanks agaran)
Protectors and chest cannot be moved by mesecon pistons or machines. Protectors and chest cannot be moved by mesecon pistons or machines.
- 2.1 - Added 'protector_night_pvp' setting so night-time becomes a free for all and - 2.1 - Added 'protector_night_pvp' setting so night-time becomes a free for all and
players can hurt one another even inside protected areas (not spawn protected) players can hurt one another even inside protected areas (not spawn protected)
- 2.2 - Updated protector tool so that player only needs to stand nearby (2 block radius) - 2.2 - Updated protector tool so that player only needs to stand nearby (2 block radius)
It can also place vertically (up and down) as well. New protector recipe added. It can also place vertically (up and down) as well. New protector recipe added.
- 2.3 - Localise many of the protector functions and tidy code. - 2.3 - Localise many of the protector functions and tidy code.
- 2.4 - Update to newer functions, Minetest 0.4.16 needed to run now. - 2.4 - Update to newer functions, Minetest 0.4.16 needed to run now.
- 2.5 - Added HUD text to show when player is inside a protected area (updates every 5 seconds) - 2.5 - Added HUD text to show when player is inside a protected area (updates every 5 seconds)
- 2.6 - Add protection against CSM tampering, updated Intllib support (thanks codexp), tweaked block textures - 2.6 - Add protection against CSM tampering, updated Intllib support (thanks codexp), tweaked block textures
- 2.7 - Remove protection field entity when protector has been dug - 2.7 - Remove protection field entity when protector has been dug
- 2.8 - Added 'protector_show_interval' setting to minetest.conf [default is 5], make protection field glow in dark. - 2.8 - Added 'protector_show_interval' setting to minetest.conf [default is 5], make protection field glow in dark.
- 2.9 - Added MineClone2 recipes for protection block but no official support as yet - 2.9 - Added MineClone2 recipes for protection block but no official support as yet
- 3.0 - Added PlayerFactions support, 'protector_hud_interval' setting and listing in advanced settings for mod values. - 3.0 - Added PlayerFactions support, 'protector_hud_interval' setting and listing in advanced settings for mod values.
- 3.1 - Ability to hide protection blocks using /protector_hide and /protector_show , italian local added (thanks Hamlet) - 3.1 - Ability to hide protection blocks using /protector_hide and /protector_show , italian local added (thanks Hamlet)
- 3.2 - Defaults to Minetest translation if found, otherwise intllib fallback if loaded, locale files updated for both. Added 'protector_msg' setting for player text. - 3.2 - Defaults to Minetest translation if found, otherwise intllib fallback if loaded, locale files updated for both. Added 'protector_msg' setting for player text.
- 3.3 - Added support for playerfactions new api (thanks louisroyer), added limiter to protection radius of 22. - 3.3 - Added support for playerfactions new api (thanks louisroyer), added limiter to protection radius of 22.
- 3.4 - Player flip and hurt functions moved to minetest.register_protection_violation function (thanks hlqkj), added 'protector_crafts' setting, changed wood doors n chests to immediate_dig for mineclone2 fix. Upped protector radius limit to 30. - 3.4 - Player flip and hurt functions moved to minetest.register_protection_violation function (thanks hlqkj), added 'protector_crafts' setting, changed wood doors n chests to immediate_dig for mineclone2 fix. Upped protector radius limit to 30.
- 3.5 - Store settings in global, reduce screenshot, tweak door sounds, use node template, add name check to commands, add commands to add and remove member names, tweak & tidy code. - 3.5 - Store settings in global, reduce screenshot, tweak door sounds, use node template, add name check to commands, add commands to add and remove member names, tweak & tidy code.
Lucky Blocks: 10 Lucky Blocks: 10
Usage: (requires server privelage) Usage: (requires server privelage)
list names to remove list names to remove
/protector_remove /protector_remove
remove specific user names remove specific user names
/protector_remove name1 name2 /protector_remove name1 name2
reset names on remove list reset names on remove list
/protector_remove - /protector_remove -
Whenever a player is near any protectors with name1 or name2 then it will be Whenever a player is near any protectors with name1 or name2 then it will be
replaced by an air block. replaced by an air block.
show owner name to replace show owner name to replace
/protector_replace /protector_replace
replace owner with new name replace owner with new name
/protector_replace owner new_owner /protector_replace owner new_owner
reset names on replace list reset names on replace list
/protector_replace - /protector_replace -
show protected areas of your nearby protectors (max of 5) show protected areas of your nearby protectors (max of 5)
/protector_show_area /protector_show_area
A players own protection blocks can be hidden and shown using the following: A players own protection blocks can be hidden and shown using the following:
/protector_hide /protector_hide
/protector_show /protector_show
Adding members to local protection can be done by using Adding members to local protection can be done by using
/protector_add_member /protector_add_member
Removing members from local protection can be done by using Removing members from local protection can be done by using
/protector_del_member /protector_del_member
The following lines can be added to your minetest.conf file to configure specific features of the mod: The following lines can be added to your minetest.conf file to configure specific features of the mod:
protector_radius = 5 protector_length = 15
- Sets the area around each protection node so that other players cannot dig, place or enter through protected doors or chests. - Sets the area around each protection node so that other players cannot dig, place or enter through protected doors or chests.
protector_pvp = true protector_pvp = true
- true or false this setting disabled pvp inside of protected areas for all players apart from those listed on the protector node. - true or false this setting disabled pvp inside of protected areas for all players apart from those listed on the protector node.
protector_night_pvp = false protector_night_pvp = false
- when true this setting enables pvp at night time only, even inside protected areas, requires protector_pvp to be active to work. - when true this setting enables pvp at night time only, even inside protected areas, requires protector_pvp to be active to work.
protector_spawn = 10 protector_spawn = 10
- Sets an area 10 nodes around static spawnpoint that is protected. - Sets an area 10 nodes around static spawnpoint that is protected.
protector_hurt = 2 protector_hurt = 2
- When set to above 0, players digging in protected areas will be hurt by 2 health points (or whichever number it's set to) - When set to above 0, players digging in protected areas will be hurt by 2 health points (or whichever number it's set to)
protector_flip = true protector_flip = true
- When true players who dig inside a protected area will flipped around to stop them using lag to grief into someone else's build - When true players who dig inside a protected area will flipped around to stop them using lag to grief into someone else's build
protector_show_interval protector_show_interval
- Number of seconds the protection field is visible, defaults to 5 seconds. - Number of seconds the protection field is visible, defaults to 5 seconds.
protector_recipe = true protector_recipe = true
- When true allows players to craft protection blocks - When true allows players to craft protection blocks
protector_msg = true protector_msg = true
- When true shows protection messages in players chat when trying to interact in someone else's area - When true shows protection messages in players chat when trying to interact in someone else's area
Protector Tool Protector Tool
Can be crafted with a protector surrounded by steel ingots and is used to place new protectors at a set distance of protector.radius in all directions including up and down simply by looking in a direction. Can be crafted with a protector surrounded by steel ingots and is used to place new protectors at a set distance of protector.radius in all directions including up and down simply by looking in a direction.
Use by standing near an existing protector, looking in a direction and using as a tool, hold sneak/shift to place new protector containing member list from inside nearest one. Use by standing near an existing protector, looking in a direction and using as a tool, hold sneak/shift to place new protector containing member list from inside nearest one.
+249 -249
View File
@@ -1,249 +1,249 @@
-- translation and default name vars -- translation and default name vars
local S = core.get_translator("protector") local S = core.get_translator("protector")
local removal_names = "" local removal_names = ""
local replace_names = "" local replace_names = ""
-- remove protection command -- remove protection command
core.register_chatcommand("protector_remove", { core.register_chatcommand("protector_remove", {
params = S("<names list>"), params = S("<names list>"),
description = S("Remove Protectors around players (separate names with spaces)"), description = S("Remove Protectors around players (separate names with spaces)"),
privs = {server = true}, privs = {server = true},
func = function(name, param) func = function(name, param)
if param == "-" then if param == "-" then
core.chat_send_player(name, S("Name List Reset")) core.chat_send_player(name, S("Name List Reset"))
removal_names = "" ; return removal_names = "" ; return
end end
if param ~= "" then if param ~= "" then
removal_names = param removal_names = param
end end
core.chat_send_player(name, core.chat_send_player(name,
S("Protector Names to remove: @1", removal_names)) S("Protector Names to remove: @1", removal_names))
end end
}) })
-- replace protection command -- replace protection command
core.register_chatcommand("protector_replace", { core.register_chatcommand("protector_replace", {
params = S("<owner name> <name to replace with>"), params = S("<owner name> <name to replace with>"),
description = S("Replace Protector Owner with name provided"), description = S("Replace Protector Owner with name provided"),
privs = {server = true}, privs = {server = true},
func = function(name, param) func = function(name, param)
-- reset list to empty -- reset list to empty
if param == "-" then if param == "-" then
core.chat_send_player(name, S("Name List Reset")) core.chat_send_player(name, S("Name List Reset"))
replace_names = "" ; return replace_names = "" ; return
end end
-- check and set replacement name -- check and set replacement name
if param ~= "" then if param ~= "" then
local names = param:split(" ") ; if not names[2] then return end local names = param:split(" ") ; if not names[2] then return end
if names[2] ~= string.match(names[2], "[%w_-]+") then if names[2] ~= string.match(names[2], "[%w_-]+") then
core.chat_send_player(name, S("Invalid player name!")) ; return core.chat_send_player(name, S("Invalid player name!")) ; return
end end
if names[2]:len() > 25 then if names[2]:len() > 25 then
core.chat_send_player(name, S("Player name too long")) ; return core.chat_send_player(name, S("Player name too long")) ; return
end end
replace_names = param replace_names = param
end end
-- show name info -- show name info
if replace_names ~= "" then if replace_names ~= "" then
local names = replace_names:split(" ") local names = replace_names:split(" ")
core.chat_send_player(name, S("Replacing Protector name @1 with @2", core.chat_send_player(name, S("Replacing Protector name @1 with @2",
names[1] or "", names[2] or "")) names[1] or "", names[2] or ""))
end end
end end
}) })
-- Abm to remove or replace protectors within active player area -- Abm to remove or replace protectors within active player area
core.register_abm({ core.register_abm({
nodenames = {"protector:protect", "protector:protect2", "protector:protect_hidden"}, nodenames = {"protector:protect", "protector:protect2", "protector:protect_hidden"},
interval = 5, interval = 5,
chance = 1, chance = 1,
catch_up = false, catch_up = false,
action = function(pos, node) action = function(pos, node)
if removal_names == "" and replace_names == "" then return end if removal_names == "" and replace_names == "" then return end
local meta = core.get_meta(pos) ; if not meta then return end local meta = core.get_meta(pos) ; if not meta then return end
local owner = meta:get_string("owner") local owner = meta:get_string("owner")
if removal_names ~= "" then if removal_names ~= "" then
local names = removal_names:split(" ") local names = removal_names:split(" ")
for _, n in pairs(names) do for _, n in pairs(names) do
if n == owner then if n == owner then
core.set_node(pos, {name = "air"}) ; return core.set_node(pos, {name = "air"}) ; return
end end
end end
end end
if replace_names ~= "" then if replace_names ~= "" then
local names = replace_names:split(" ") local names = replace_names:split(" ")
if names[1] and names[2] and owner == names[1] then if names[1] and names[2] and owner == names[1] then
meta:set_string("owner", names[2]) meta:set_string("owner", names[2])
meta:set_string("infotext", S("Protection (owned by @1)", names[2])) meta:set_string("infotext", S("Protection (owned by @1)", names[2]))
end end
end end
end end
}) })
-- show protection areas of nearby protectors owned by you (thanks agaran) -- show protection areas of nearby protectors owned by you (thanks agaran)
local r = protector.radius local r = protector.length
core.register_chatcommand("protector_show_area", { core.register_chatcommand("protector_show_area", {
params = "", params = "",
description = S("Show protected areas of your nearby protectors"), description = S("Show protected areas of your nearby protectors"),
privs = {}, privs = {},
func = function(name, param) func = function(name, param)
local player = core.get_player_by_name(name) local player = core.get_player_by_name(name)
local pos = player:get_pos() local pos = player:get_pos()
-- find the protector nodes -- find the protector nodes
local pos = core.find_nodes_in_area( local pos = core.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},
{x = pos.x + r, y = pos.y + r, z = pos.z + r}, {x = pos.x, y = pos.y, z = pos.z},
{"protector:protect", "protector:protect2", "protector:protect_hidden"}) {"protector:protect", "protector:protect2", "protector:protect_hidden"})
local meta, owner local meta, owner
-- show a maximum of 5 protected areas only -- show a maximum of 5 protected areas only
for n = 1, math.min(#pos, 5) do for n = 1, math.min(#pos, 5) do
meta = core.get_meta(pos[n]) meta = core.get_meta(pos[n])
owner = meta:get_string("owner") or "" owner = meta:get_string("owner") or ""
if owner == name if owner == name
or core.check_player_privs(name, {protection_bypass = true}) then or core.check_player_privs(name, {protection_bypass = true}) then
core.add_entity(pos[n], "protector:display") core.add_entity({x=pos[n].x+r, y=pos[n].y+r, z=pos[n].z+r}, "protector:display")
end end
end end
end end
}) })
-- ability to hide protection blocks (borrowed from doors mod :) -- ability to hide protection blocks (borrowed from doors mod :)
core.register_node("protector:protect_hidden", { core.register_node("protector:protect_hidden", {
description = "Hidden Protector", description = "Hidden Protector",
drawtype = "airlike", drawtype = "airlike",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
sunlight_propagates = true, sunlight_propagates = true,
-- has to be walkable for falling nodes to stop falling -- has to be walkable for falling nodes to stop falling
walkable = true, walkable = true,
pointable = false, pointable = false,
diggable = false, diggable = false,
buildable_to = false, buildable_to = false,
floodable = false, floodable = false,
drop = "", drop = "",
groups = {not_in_creative_inventory = 1, unbreakable = 1}, groups = {not_in_creative_inventory = 1, unbreakable = 1},
is_ground_content = false, is_ground_content = false,
on_blast = function() end, on_blast = function() end,
-- 1px block to stop falling nodes replacing protector -- 1px block to stop falling nodes replacing protector
collision_box = { collision_box = {
type = "fixed", fixed = {-15/32, 13/32, -15/32, -13/32, 1/2, -13/32} type = "fixed", fixed = {-15/32, 13/32, -15/32, -13/32, 1/2, -13/32}
} }
}) })
-- make own protectors visible in area -- make own protectors visible in area
core.register_chatcommand("protector_show", { core.register_chatcommand("protector_show", {
params = "", params = "",
description = S("Show your nearby protection blocks"), description = S("Show your nearby protection blocks"),
privs = {interact = true}, privs = {interact = true},
func = function(name, param) func = function(name, param)
local player = core.get_player_by_name(name) local player = core.get_player_by_name(name)
if not player then if not player then
return false, S("Player not found.") return false, S("Player not found.")
end end
local pos = player:get_pos() local pos = player:get_pos()
local a = core.find_nodes_in_area( local a = core.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},
{x = pos.x + r, y = pos.y + r, z = pos.z + r}, {x = pos.x, y = pos.y, z = pos.z},
{"protector:protect_hidden"}) {"protector:protect_hidden"})
local meta, owner local meta, owner
for _, row in pairs(a) do for _, row in pairs(a) do
meta = core.get_meta(row) meta = core.get_meta(row)
owner = meta:get_string("owner") or "" owner = meta:get_string("owner") or ""
if owner == name if owner == name
or core.check_player_privs(name, {protection_bypass = true}) then or core.check_player_privs(name, {protection_bypass = true}) then
core.swap_node(row, {name = "protector:protect"}) core.swap_node(row, {name = "protector:protect"})
end end
end end
end end
}) })
-- make own protectors invisible in area -- make own protectors invisible in area
core.register_chatcommand("protector_hide", { core.register_chatcommand("protector_hide", {
params = "", params = "",
description = S("Hide your nearby protection blocks"), description = S("Hide your nearby protection blocks"),
privs = {interact = true}, privs = {interact = true},
func = function(name, param) func = function(name, param)
local player = core.get_player_by_name(name) local player = core.get_player_by_name(name)
if not player then if not player then
return false, S("Player not found.") return false, S("Player not found.")
end end
local pos = player:get_pos() local pos = player:get_pos()
local a = core.find_nodes_in_area( local a = core.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},
{x = pos.x + r, y = pos.y + r, z = pos.z + r}, {x = pos.x, y = pos.y, z = pos.z},
{"protector:protect", "protector:protect2"}) {"protector:protect", "protector:protect2"})
local meta, owner local meta, owner
for _, row in pairs(a) do for _, row in pairs(a) do
meta = core.get_meta(row) meta = core.get_meta(row)
owner = meta:get_string("owner") or "" owner = meta:get_string("owner") or ""
if owner == name if owner == name
or core.check_player_privs(name, {protection_bypass = true}) then or core.check_player_privs(name, {protection_bypass = true}) then
core.swap_node(row, {name = "protector:protect_hidden"}) core.swap_node(row, {name = "protector:protect_hidden"})
end end
end end
end end
}) })
+260 -260
View File
@@ -1,260 +1,260 @@
-- translation -- translation
local S = core.get_translator("protector") local S = core.get_translator("protector")
local F = core.formspec_escape local F = core.formspec_escape
-- MineClone support -- MineClone support
local mcl = core.get_modpath("mcl_core") local mcl = core.get_modpath("mcl_core")
local mcf = core.get_modpath("mcl_formspec") local mcf = core.get_modpath("mcl_formspec")
-- Are crafts enabled? -- Are crafts enabled?
local protector_crafts = core.settings:get_bool("protector_crafts") ~= false local protector_crafts = core.settings:get_bool("protector_crafts") ~= false
-- Protected Chest -- Protected Chest
local chest_size = mcl and (9 * 3) or (8 * 4) local chest_size = mcl and (9 * 3) or (8 * 4)
core.register_node("protector:chest", { core.register_node("protector:chest", {
description = S("Protected Chest"), description = S("Protected Chest"),
tiles = { tiles = {
"default_chest_top.png", "default_chest_top.png", "default_chest_top.png", "default_chest_top.png",
"default_chest_side.png", "default_chest_side.png", "default_chest_side.png", "default_chest_side.png",
"default_chest_side.png", "default_chest_front.png^protector_logo.png" "default_chest_side.png", "default_chest_front.png^protector_logo.png"
}, },
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {dig_immediate = 2, unbreakable = 1}, groups = {dig_immediate = 2, unbreakable = 1},
legacy_facedir_simple = true, legacy_facedir_simple = true,
is_ground_content = false, is_ground_content = false,
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
on_construct = function(pos) on_construct = function(pos)
local meta = core.get_meta(pos) local meta = core.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
meta:set_string("infotext", S("Protected Chest")) meta:set_string("infotext", S("Protected Chest"))
meta:set_string("name", S("Protected Chest")) meta:set_string("name", S("Protected Chest"))
inv:set_size("main", chest_size) inv:set_size("main", chest_size)
end, end,
can_dig = function(pos,player) can_dig = function(pos,player)
local meta = core.get_meta(pos) local meta = core.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
if inv:is_empty("main") then if inv:is_empty("main") then
if not core.is_protected(pos, player:get_player_name()) then if not core.is_protected(pos, player:get_player_name()) then
return true return true
end end
end end
end, end,
on_metadata_inventory_put = function(pos, listname, index, stack, player) on_metadata_inventory_put = function(pos, listname, index, stack, player)
core.log("action", player:get_player_name() core.log("action", player:get_player_name()
.. " moves stuff to protected chest at " .. core.pos_to_string(pos)) .. " moves stuff to protected chest at " .. core.pos_to_string(pos))
end, end,
on_metadata_inventory_take = function(pos, listname, index, stack, player) on_metadata_inventory_take = function(pos, listname, index, stack, player)
core.log("action", player:get_player_name() core.log("action", player:get_player_name()
.. " takes stuff from protected chest at " .. core.pos_to_string(pos)) .. " takes stuff from protected chest at " .. core.pos_to_string(pos))
end, end,
on_metadata_inventory_move = function( on_metadata_inventory_move = function(
pos, from_list, from_index, to_list, to_index, count, player) pos, from_list, from_index, to_list, to_index, count, player)
core.log("action", player:get_player_name() core.log("action", player:get_player_name()
.. " moves stuff inside protected chest at " .. core.pos_to_string(pos)) .. " moves stuff inside protected chest at " .. core.pos_to_string(pos))
end, end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player) allow_metadata_inventory_put = function(pos, listname, index, stack, player)
if core.is_protected(pos, player:get_player_name()) then if core.is_protected(pos, player:get_player_name()) then
return 0 return 0
end end
return stack:get_count() return stack:get_count()
end, end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player) allow_metadata_inventory_take = function(pos, listname, index, stack, player)
if core.is_protected(pos, player:get_player_name()) then if core.is_protected(pos, player:get_player_name()) then
return 0 return 0
end end
return stack:get_count() return stack:get_count()
end, end,
allow_metadata_inventory_move = function( allow_metadata_inventory_move = function(
pos, from_list, from_index, to_list, to_index, count, player) pos, from_list, from_index, to_list, to_index, count, player)
if core.is_protected(pos, player:get_player_name()) then if core.is_protected(pos, player:get_player_name()) then
return 0 return 0
end end
return count return count
end, end,
on_rightclick = function(pos, node, clicker) on_rightclick = function(pos, node, clicker)
if core.is_protected(pos, clicker:get_player_name()) then return end if core.is_protected(pos, clicker:get_player_name()) then return end
local meta = core.get_meta(pos) ; if not meta then return end local meta = core.get_meta(pos) ; if not meta then return end
local spos = pos.x .. "," .. pos.y .. "," ..pos.z local spos = pos.x .. "," .. pos.y .. "," ..pos.z
local formspec local formspec
-- mineclone support -- mineclone support
if mcl and mcf then if mcl and mcf then
formspec = "size[9,8.75]" formspec = "size[9,8.75]"
.. "label[0,0;" .. core.formspec_escape( .. "label[0,0;" .. core.formspec_escape(
core.colorize("#313131", "Protected Chest")) .. "]" core.colorize("#313131", "Protected Chest")) .. "]"
.. "list[nodemeta:" .. spos .. ";main;0,0.5;9,3;]" .. "list[nodemeta:" .. spos .. ";main;0,0.5;9,3;]"
.. mcl_formspec.get_itemslot_bg(0,0.5,9,3) .. mcl_formspec.get_itemslot_bg(0,0.5,9,3)
.. "image_button[3.0,3.5;1.05,0.8;protector_up_icon.png;protect_up;]" .. "image_button[3.0,3.5;1.05,0.8;protector_up_icon.png;protect_up;]"
.. "image_button[4.0,3.5;1.05,0.8;protector_down_icon.png;protect_down;]" .. "image_button[4.0,3.5;1.05,0.8;protector_down_icon.png;protect_down;]"
.. "label[0,4.0;" .. core.formspec_escape( .. "label[0,4.0;" .. core.formspec_escape(
core.colorize("#313131", "Inventory")) .. "]" core.colorize("#313131", "Inventory")) .. "]"
.. "list[current_player;main;0,4.5;9,3;9]" .. "list[current_player;main;0,4.5;9,3;9]"
.. mcl_formspec.get_itemslot_bg(0,4.5,9,3) .. mcl_formspec.get_itemslot_bg(0,4.5,9,3)
.. "list[current_player;main;0,7.74;9,1;]" .. "list[current_player;main;0,7.74;9,1;]"
.. mcl_formspec.get_itemslot_bg(0,7.74,9,1) .. mcl_formspec.get_itemslot_bg(0,7.74,9,1)
.. "listring[nodemeta:" .. spos .. ";main]" .. "listring[nodemeta:" .. spos .. ";main]"
.. "listring[current_player;main]" .. "listring[current_player;main]"
else -- default formspec else -- default formspec
formspec = "size[8,9]" formspec = "size[8,9]"
.. "list[nodemeta:".. spos .. ";main;0,0.3;8,4;]" .. "list[nodemeta:".. spos .. ";main;0,0.3;8,4;]"
.. "image_button[-0.01,4.26;1.05,0.8;protector_up_icon.png;protect_up;]" .. "image_button[-0.01,4.26;1.05,0.8;protector_up_icon.png;protect_up;]"
.. "image_button[0.98,4.26;1.05,0.8;protector_down_icon.png;protect_down;]" .. "image_button[0.98,4.26;1.05,0.8;protector_down_icon.png;protect_down;]"
.. "tooltip[protect_up;" .. S("To Chest") .. "]" .. "tooltip[protect_up;" .. S("To Chest") .. "]"
.. "tooltip[protect_down;" .. S("To Inventory") .. "]" .. "tooltip[protect_down;" .. S("To Inventory") .. "]"
.. "field[2.3,4.8;4,0.25;protect_name;;" .. "field[2.3,4.8;4,0.25;protect_name;;"
.. meta:get_string("name") .. "]" .. meta:get_string("name") .. "]"
.. "button[5.99,4.5;2.05,0.25;protect_rename;" .. S("Rename") .. "]" .. "button[5.99,4.5;2.05,0.25;protect_rename;" .. S("Rename") .. "]"
.. "list[current_player;main;0,5;8,1;]" .. "list[current_player;main;0,5;8,1;]"
.. "list[current_player;main;0,6.08;8,3;8]" .. "list[current_player;main;0,6.08;8,3;8]"
.. "listring[nodemeta:" .. spos .. ";main]" .. "listring[nodemeta:" .. spos .. ";main]"
.. "listring[current_player;main]" .. "listring[current_player;main]"
end end
core.sound_play("default_chest_open", { core.sound_play("default_chest_open", {
gain = 0.3, pos = pos, max_hear_distance = 10}, true) gain = 0.3, pos = pos, max_hear_distance = 10}, true)
core.show_formspec(clicker:get_player_name(), core.show_formspec(clicker:get_player_name(),
"protector:chest_" .. core.pos_to_string(pos), formspec) "protector:chest_" .. core.pos_to_string(pos), formspec)
end, end,
on_blast = function() end on_blast = function() end
}) })
-- Container transfer helper -- Container transfer helper
local function to_from(src, dst) local function to_from(src, dst)
local stack, item, leftover local stack, item, leftover
local size = dst:get_size("main") local size = dst:get_size("main")
for i = 1, size do for i = 1, size do
stack = src:get_stack("main", i) stack = src:get_stack("main", i)
item = stack:get_name() item = stack:get_name()
if item ~= "" and dst:room_for_item("main", item) then if item ~= "" and dst:room_for_item("main", item) then
leftover = dst:add_item("main", stack) leftover = dst:add_item("main", stack)
if leftover and not leftover:is_empty() then if leftover and not leftover:is_empty() then
src:set_stack("main", i, leftover) src:set_stack("main", i, leftover)
else else
src:set_stack("main", i, nil) src:set_stack("main", i, nil)
end end
end end
end end
end end
-- Protected Chest formspec buttons -- Protected Chest formspec buttons
core.register_on_player_receive_fields(function(player, formname, fields) core.register_on_player_receive_fields(function(player, formname, fields)
if string.sub(formname, 0, 16) ~= "protector:chest_" then return end if string.sub(formname, 0, 16) ~= "protector:chest_" then return end
local pos_s = string.sub(formname, 17) local pos_s = string.sub(formname, 17)
local pos = core.string_to_pos(pos_s) local pos = core.string_to_pos(pos_s)
if core.is_protected(pos, player:get_player_name()) then return end if core.is_protected(pos, player:get_player_name()) then return end
local meta = core.get_meta(pos) ; if not meta then return end local meta = core.get_meta(pos) ; if not meta then return end
local chest_inv = meta:get_inventory() ; if not chest_inv then return end local chest_inv = meta:get_inventory() ; if not chest_inv then return end
local player_inv = player:get_inventory() local player_inv = player:get_inventory()
-- copy contents of player inventory to chest -- copy contents of player inventory to chest
if fields.protect_up then if fields.protect_up then
to_from(player_inv, chest_inv) to_from(player_inv, chest_inv)
-- copy contents of chest to player inventory -- copy contents of chest to player inventory
elseif fields.protect_down then elseif fields.protect_down then
to_from(chest_inv, player_inv) to_from(chest_inv, player_inv)
elseif fields.protect_name or fields.protect_rename then elseif fields.protect_name or fields.protect_rename then
-- change chest infotext to display name -- change chest infotext to display name
if fields.protect_name ~= "" then if fields.protect_name ~= "" then
if fields.protect_name ~= string.match(fields.protect_name, "[%w%s_-]+") if fields.protect_name ~= string.match(fields.protect_name, "[%w%s_-]+")
or fields.protect_name:len() > 35 then or fields.protect_name:len() > 35 then
return return
end end
meta:set_string("name", fields.protect_name) meta:set_string("name", fields.protect_name)
meta:set_string("infotext", fields.protect_name) meta:set_string("infotext", fields.protect_name)
else else
meta:set_string("name", S("Protected Chest")) meta:set_string("name", S("Protected Chest"))
meta:set_string("infotext", S("Protected Chest")) meta:set_string("infotext", S("Protected Chest"))
end end
elseif fields.quit then elseif fields.quit then
core.sound_play("default_chest_close", { core.sound_play("default_chest_close", {
gain = 0.3, pos = pos, max_hear_distance = 10}, true) gain = 0.3, pos = pos, max_hear_distance = 10}, true)
end end
end) end)
-- Protected Chest recipes -- Protected Chest recipes
if protector_crafts then if protector_crafts then
if mcl then if mcl then
core.register_craft({ core.register_craft({
output = "protector:chest", output = "protector:chest",
recipe = { {"mcl_chests:chest", "mcl_core:gold_ingot"} } recipe = { {"mcl_chests:chest", "mcl_core:gold_ingot"} }
}) })
else else
core.register_craft({ core.register_craft({
output = "protector:chest", output = "protector:chest",
recipe = { recipe = {
{"group:wood", "group:wood", "group:wood"}, {"group:wood", "group:wood", "group:wood"},
{"group:wood", "default:copper_ingot", "group:wood"}, {"group:wood", "default:copper_ingot", "group:wood"},
{"group:wood", "group:wood", "group:wood"} {"group:wood", "group:wood", "group:wood"}
} }
}) })
core.register_craft({ core.register_craft({
output = "protector:chest", output = "protector:chest",
recipe = { {"default:chest", "default:copper_ingot"} } recipe = { {"default:chest", "default:copper_ingot"} }
}) })
end end
end end
+521 -521
View File
File diff suppressed because it is too large Load Diff
+82 -82
View File
@@ -1,82 +1,82 @@
-- translation and protector radius -- translation and protector length
local S = core.get_translator("protector") local S = core.get_translator("protector")
local radius = protector.radius local length = protector.length
-- hud settings -- hud settings
local hud = {} local hud = {}
local hud_timer = 0 local hud_timer = 0
local hud_interval = (tonumber(core.settings:get("protector_hud_interval")) or 4) local hud_interval = (tonumber(core.settings:get("protector_hud_interval")) or 4)
local hud_style = core.has_feature("hud_def_type_field") local hud_style = core.has_feature("hud_def_type_field")
if hud_interval > 0 then if hud_interval > 0 then
core.register_globalstep(function(dtime) core.register_globalstep(function(dtime)
hud_timer = hud_timer + dtime hud_timer = hud_timer + dtime
if hud_timer < hud_interval then return end if hud_timer < hud_interval then return end
hud_timer = 0 hud_timer = 0
for _, player in pairs(core.get_connected_players()) do for _, player in pairs(core.get_connected_players()) do
local name = player:get_player_name() local name = player:get_player_name()
local pos = vector.round(player:get_pos()) local pos = vector.round(player:get_pos())
local hud_text = "" local hud_text = ""
local protectors = core.find_nodes_in_area( local protectors = core.find_nodes_in_area(
{x = pos.x - radius , y = pos.y - radius , z = pos.z - radius}, {x = pos.x - length, y = pos.y - length, z = pos.z - length},
{x = pos.x + radius , y = pos.y + radius , z = pos.z + radius}, {x = pos.x, y = pos.y, z = pos.z},
{"protector:protect","protector:protect2", "protector:protect_hidden"}) {"protector:protect","protector:protect2", "protector:protect_hidden"})
if #protectors > 0 then if #protectors > 0 then
local npos = protectors[1] local npos = protectors[1]
local meta = core.get_meta(npos) local meta = core.get_meta(npos)
local nodeowner = meta:get_string("owner") local nodeowner = meta:get_string("owner")
local members = meta:get_string("members"):split(" ") local members = meta:get_string("members"):split(" ")
hud_text = S("Owner: @1", nodeowner) hud_text = S("Owner: @1", nodeowner)
if #members > 0 then if #members > 0 then
hud_text = hud_text .. " [" .. #members .. "]" hud_text = hud_text .. " [" .. #members .. "]"
end end
end end
if not hud[name] then if not hud[name] then
hud[name] = {} hud[name] = {}
local hud_tab = { local hud_tab = {
name = "Protector Area", name = "Protector Area",
number = 0xFFFF22, number = 0xFFFF22,
position = {x = 0, y = 0.95}, position = {x = 0, y = 0.95},
offset = {x = 8, y = -8}, offset = {x = 8, y = -8},
text = hud_text, text = hud_text,
scale = {x = 200, y = 60}, scale = {x = 200, y = 60},
alignment = {x = 1, y = -1}, alignment = {x = 1, y = -1},
} }
if hud_style then if hud_style then
hud_tab["type"] = "text" hud_tab["type"] = "text"
else else
hud_tab["hud_elem_type"] = "text" hud_tab["hud_elem_type"] = "text"
end end
hud[name].id = player:hud_add(hud_tab) hud[name].id = player:hud_add(hud_tab)
return return
else else
player:hud_change(hud[name].id, "text", hud_text) player:hud_change(hud[name].id, "text", hud_text)
end end
end end
end) end)
core.register_on_leaveplayer(function(player) core.register_on_leaveplayer(function(player)
hud[player:get_player_name()] = nil hud[player:get_player_name()] = nil
end) end)
end -- END hud_interval > 0 end -- END hud_interval > 0
+923 -907
View File
File diff suppressed because it is too large Load Diff
+33 -33
View File
@@ -1,33 +1,33 @@
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2025 TenPlus1 Copyright (c) 2025 TenPlus1
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software. all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
Original doors mod code (WTFPL license) Original doors mod code (WTFPL license)
Textures by TenPlus1 (CC0) unless mentioned below Textures by TenPlus1 (CC0) unless mentioned below
Textures from original Minetest doors mod (CC-BY-SA 3.0) Textures from original Minetest doors mod (CC-BY-SA 3.0)
doors_*.png doors_*.png
..default_chest*.png ..default_chest*.png
Textures by Sirrobzeroone (CC0) Textures by Sirrobzeroone (CC0)
protector_tool.png protector_tool.png
+56 -56
View File
@@ -1,57 +1,57 @@
# textdomain: protector # textdomain: protector
# author: Xanthin and CodeXP # author: Xanthin and CodeXP
# last update: 2020/Jul/12 # last update: 2020/Jul/12
### admin.lua ### ### 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) 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> <names list>=<Namensliste der Spieler>
Replace Protector Owner with name provided=Ersetze Besitzer der Störschützer mit neuem Besitzer 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> <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' 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 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 Protector Names to remove: @1=Störschutznamen zum Entfernen: @1
Name List Reset=Namensliste zurückgesetzt Name List Reset=Namensliste zurückgesetzt
Invalid player name!= Invalid player name!=
Player name too long= Player name too long=
Player not found.= Player not found.=
### doors_chest.lua ### ### doors_chest.lua ###
Protected Wooden Door=Geschützte Holztür Protected Wooden Door=Geschützte Holztür
Protected Steel Door=Geschützte Stahltür Protected Steel Door=Geschützte Stahltür
Protected Trapdoor=Geschützte Falltür Protected Trapdoor=Geschützte Falltür
Protected Steel Trapdoor=Geschützte Stahlfalltür Protected Steel Trapdoor=Geschützte Stahlfalltür
Protected Chest=Geschützte Truhe Protected Chest=Geschützte Truhe
To Chest=Zur Truhe To Chest=Zur Truhe
To Inventory=Zum Inventar To Inventory=Zum Inventar
Protected Chest (@1)=Geschützte Truhe (@1) Protected Chest (@1)=Geschützte Truhe (@1)
### init.lua ### ### init.lua ###
-- Protector interface --=-- Störschutz-Interface -- -- Protector interface --=-- Störschutz-Interface --
PUNCH node to show protected area=SCHLAGE Node, um geschützten Bereich anzuzeigen oder PUNCH node to show protected area=SCHLAGE Node, um geschützten Bereich anzuzeigen oder
USE for area check=BENUTZE für Bereichsprüfung USE for area check=BENUTZE für Bereichsprüfung
Members:=Mitglieder: Members:=Mitglieder:
Close=Schließen Close=Schließen
Protection located at: @1=Störschutz befindet sich bei: @1 Protection located at: @1=Störschutz befindet sich bei: @1
Members: @1.=Mitglieder: @1. Members: @1.=Mitglieder: @1.
Allow faction access= Allow faction access=
This area is not protected.=Dieser Bereich ist nicht geschützt. This area is not protected.=Dieser Bereich ist nicht geschützt.
You can build here.=Du kannst hier bauen. You can build here.=Du kannst hier bauen.
Overlaps into above players protected area=Überlappung im geschützen Bereich eines Spielers Overlaps into above players protected area=Überlappung im geschützen Bereich eines Spielers
Protection Block=Störschutzblock Protection Block=Störschutzblock
Protection (owned by @1)=Störschutz (gehört @1) Protection (owned by @1)=Störschutz (gehört @1)
Protection Logo=Störschutzlogo Protection Logo=Störschutzlogo
[MOD] Protector Redo loaded=[MOD] Protector Redo geladen [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. 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 This area is owned by @1=Dieser Bereich gehört @1
### hud.lua ### ### hud.lua ###
Owner: @1=Besitzer: @1 Owner: @1=Besitzer: @1
### tool.lua ### ### 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 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! Protector already in place!=Störschutz is bereits platziert!
No protectors available to place!=Keine Störschützer mehr im Inventar! No protectors available to place!=Keine Störschützer mehr im Inventar!
"Protector placed at @1"=Störschutz befindet sich bei: @1 "Protector placed at @1"=Störschutz befindet sich bei: @1
Out of bounds!= Out of bounds!=
Cannot place protector, already protected at @1= Cannot place protector, already protected at @1=
Cannot place protector, container at @1= Cannot place protector, container at @1=
+57 -57
View File
@@ -1,57 +1,57 @@
# textdomain: protector # textdomain: protector
# author: universales # author: universales
# last update: 2020-02-27 # last update: 2020-02-27
### admin.lua ### ### admin.lua ###
Remove Protectors around players (separate names with spaces)=Eliminar protectores alrededor de los jugadores (nombres separados con espacios) Remove Protectors around players (separate names with spaces)=Eliminar protectores alrededor de los jugadores (nombres separados con espacios)
<names list>=<Lista de nombres> <names list>=<Lista de nombres>
Replace Protector Owner with name provided=Reemplace el propietario del protector con el nombre proporcionado 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> <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' 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 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 Protector Names to remove: @1=Nombres de protectores para eliminar: @1
Name List Reset=Restablecer lista de nombres Name List Reset=Restablecer lista de nombres
Invalid player name!= Invalid player name!=
Player name too long= Player name too long=
Player not found.= Player not found.=
### doors_chest.lua ### ### doors_chest.lua ###
Protected Wooden Door=Puerta de madera protegida Protected Wooden Door=Puerta de madera protegida
Protected Steel Door=Puerta de hierro protegida Protected Steel Door=Puerta de hierro protegida
Protected Trapdoor=Trampilla Protegida Protected Trapdoor=Trampilla Protegida
Protected Steel Trapdoor=Trampilla de hierro protegida Protected Steel Trapdoor=Trampilla de hierro protegida
Protected Chest=Cofre protegido Protected Chest=Cofre protegido
To Chest=Al cofre To Chest=Al cofre
To Inventory=Al inventario To Inventory=Al inventario
Protected Chest (@1)=Cofre protegido (@1) Protected Chest (@1)=Cofre protegido (@1)
### init.lua ### ### init.lua ###
-- Protector interface --=-- Interfaz del protector -- -- Protector interface --=-- Interfaz del protector --
PUNCH node to show protected area=nodo de perforación para mostrar el área protegida PUNCH node to show protected area=nodo de perforación para mostrar el área protegida
USE for area check=Usar para chequeo del área USE for area check=Usar para chequeo del área
Members:=Miembros: Members:=Miembros:
Close=Cerrar Close=Cerrar
Protection located at: @1=Protección ubicada en: @1 Protection located at: @1=Protección ubicada en: @1
Members: @1.=Miembros: @1. Members: @1.=Miembros: @1.
This area is not protected.=Esta área no está protegida. This area is not protected.=Esta área no está protegida.
You can build here.=Puedes construir aquí. You can build here.=Puedes construir aquí.
Overlaps into above players protected area=Se superpone en el área protegida de los jugadores anteriores Overlaps into above players protected area=Se superpone en el área protegida de los jugadores anteriores
Protection Block=Bloque de protección Protection Block=Bloque de protección
Protection (owned by @1)=Protegido (Propiedad de @1) Protection (owned by @1)=Protegido (Propiedad de @1)
Protection Logo=Logotipo de la protección Protection Logo=Logotipo de la protección
[MOD] Protector Redo loaded=[MOD] Protector recargado [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. 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 This area is owned by @1=Esta área es propiedad de @1
Factions: (use * to allow any of your factions)=Facciones: (utiliza * para autorizar todas tus facciones) Factions: (use * to allow any of your factions)=Facciones: (utiliza * para autorizar todas tus facciones)
### hud.lua ### ### hud.lua ###
Owner: @1=Propietario: @1 Owner: @1=Propietario: @1
### tool.lua ### ### 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 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! Protector already in place!=¡El protector ya está en este lugar!
No protectors available to place!=¡No hay protectores disponibles para colocar! No protectors available to place!=¡No hay protectores disponibles para colocar!
Protector placed at @1=Protector colocado en @1 Protector placed at @1=Protector colocado en @1
Out of bounds!= Out of bounds!=
Cannot place protector, already protected at @1= Cannot place protector, already protected at @1=
Cannot place protector, container at @1= Cannot place protector, container at @1=
+57 -57
View File
@@ -1,57 +1,57 @@
# textdomain: protector # textdomain: protector
# author: CodeXP and TenPlus1 # author: CodeXP and TenPlus1
# last update: 2020/Jul/12 # last update: 2020/Jul/12
### admin.lua ### ### 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) 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> <names list>=<liste de noms>
Replace Protector Owner with name provided=Remplacer le propriétaire du protecteur par le nom fourni 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> <nouveau nom> <owner name> <name to replace with>=<nom du propriétaire> <nouveau nom>
Replacing Protector name '@1' with '@2'=Remplacement du nom du protecteur '@1' par '@2' Replacing Protector name '@1' with '@2'=Remplacement du nom du protecteur '@1' par '@2'
Show protected areas of your nearby protectors=Afficher les zones protégées de vos protecteurs à proximité Show protected areas of your nearby protectors=Afficher les zones protégées de vos protecteurs à proximité
Protector Names to remove: @1=Noms de protecteurs à supprimer : @1 Protector Names to remove: @1=Noms de protecteurs à supprimer : @1
Name List Reset=Liste de noms réinitialisée Name List Reset=Liste de noms réinitialisée
Invalid player name!=Nom de joueur invalide ! Invalid player name!=Nom de joueur invalide !
Player name too long=Nom de joueur trop long Player name too long=Nom de joueur trop long
Player not found.=Joueur inconnu. Player not found.=Joueur inconnu.
### doors_chest.lua ### ### doors_chest.lua ###
Protected Wooden Door=Porte en bois protégée Protected Wooden Door=Porte en bois protégée
Protected Steel Door=Porte en acier protégée Protected Steel Door=Porte en acier protégée
Protected Trapdoor=Trappe protégée Protected Trapdoor=Trappe protégée
Protected Steel Trapdoor=Trappe en acier protégée Protected Steel Trapdoor=Trappe en acier protégée
Protected Chest=Coffre protégé Protected Chest=Coffre protégé
To Chest=Vers le coffre To Chest=Vers le coffre
To Inventory=Vers l'inventaire To Inventory=Vers l'inventaire
Protected Chest (@1)=Coffre protégé (@1) Protected Chest (@1)=Coffre protégé (@1)
### init.lua ### ### init.lua ###
-- Protector interface --=-- Interface Protector -- -- Protector interface --=-- Interface Protector --
PUNCH node to show protected area=TAPER le bloc pour afficher la zone protégée PUNCH node to show protected area=TAPER le bloc pour afficher la zone protégée
USE for area check=UTILISER pour vérifier la zone USE for area check=UTILISER pour vérifier la zone
Members:=Membres : Members:=Membres :
Close=Fermer Close=Fermer
Protection located at: @1=Protection située à : @1 Protection located at: @1=Protection située à : @1
Members: @1.=Membres : @1. Members: @1.=Membres : @1.
This area is not protected.=msgstr "Cette zone n'est pas protégée. This area is not protected.=msgstr "Cette zone n'est pas protégée.
You can build here.=Vous pouvez construire ici. You can build here.=Vous pouvez construire ici.
Overlaps into above players protected area=La zone chevauche une autre zone protégée. Overlaps into above players protected area=La zone chevauche une autre zone protégée.
Protection Block=Bloc de protection Protection Block=Bloc de protection
Protection (owned by @1)=Protection (détenue par @1) Protection (owned by @1)=Protection (détenue par @1)
Protection Logo=Logo de protection Protection Logo=Logo de protection
[MOD] Protector Redo loaded=[MOD] Protector Redo chargé [MOD] Protector Redo loaded=[MOD] Protector Redo chargé
Spawn @1 has been protected up to a @2 block radius.=Le spawn @1 est protégé dans un rayon de @2 blocs. Spawn @1 has been protected up to a @2 block radius.=Le spawn @1 est protégé dans un rayon de @2 blocs.
This area is owned by @1=Cette zone appartient à @1 ! This area is owned by @1=Cette zone appartient à @1 !
Factions: (use * to allow any of your factions)=Factions : (taper * pour autoriser toutes vos factions) Factions: (use * to allow any of your factions)=Factions : (taper * pour autoriser toutes vos factions)
### hud.lua ### ### hud.lua ###
Owner: @1=Propriétaire : @1 Owner: @1=Propriétaire : @1
### tool.lua ### ### tool.lua ###
Protector Placer Tool (stand near protector, face direction and use)=Outil de placement du protecteur (se tenir près du protecteur, dans la bonne direction et utiliser) Protector Placer Tool (stand near protector, face direction and use)=Outil de placement du protecteur (se tenir près du protecteur, dans la bonne direction et utiliser)
Protector already in place!=Protecteur déjà en place ! Protector already in place!=Protecteur déjà en place !
No protectors available to place!=Aucun protecteur disponible à placer ! No protectors available to place!=Aucun protecteur disponible à placer !
Protector placed at @1=Protection située à : @1 Protector placed at @1=Protection située à : @1
Out of bounds!=Hors limites ! Out of bounds!=Hors limites !
Cannot place protector, already protected at @1=Le protecteur ne peut être placé, déjà protégé à @1 Cannot place protector, already protected at @1=Le protecteur ne peut être placé, déjà protégé à @1
Cannot place protector, container at @1=Le protecteur ne peut être placé, conteneur à @1 Cannot place protector, container at @1=Le protecteur ne peut être placé, conteneur à @1
+56 -56
View File
@@ -1,57 +1,57 @@
# textdomain: protector # textdomain: protector
# author: Xanthin and CodeXP # author: Xanthin and CodeXP
# last update: 2018/Jul/10 # last update: 2018/Jul/10
### admin.lua ### ### admin.lua ###
Remove Protectors around players (separate names with spaces)=Elimina i protettori attorno ai giocatori (separa i nomi con gli spazi) Remove Protectors around players (separate names with spaces)=Elimina i protettori attorno ai giocatori (separa i nomi con gli spazi)
<names list>=<elenco nomi> <names list>=<elenco nomi>
Replace Protector Owner with name provided=Sostituisci il proprietario del protettore col nome fornito 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> <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' 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 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 Protector Names to remove: @1=Nomi dei protettori da eliminare: @1
Name List Reset=Azzera l'elenco dei nomi Name List Reset=Azzera l'elenco dei nomi
Invalid player name!= Invalid player name!=
Player name too long= Player name too long=
Player not found.= Player not found.=
### doors_chest.lua ### ### doors_chest.lua ###
Protected Wooden Door=Porta di legno protetta Protected Wooden Door=Porta di legno protetta
Protected Steel Door=Porta d'acciaio protetta Protected Steel Door=Porta d'acciaio protetta
Protected Trapdoor=Botola protetta Protected Trapdoor=Botola protetta
Protected Steel Trapdoor=Botola d'acciaio protetta Protected Steel Trapdoor=Botola d'acciaio protetta
Protected Chest=Baule protetto Protected Chest=Baule protetto
To Chest=Al baule To Chest=Al baule
To Inventory=All'inventario To Inventory=All'inventario
Protected Chest (@1)=Baule protetto (@1) Protected Chest (@1)=Baule protetto (@1)
### init.lua ### ### init.lua ###
-- Protector interface --=-- Interfaccia protettore -- -- Protector interface --=-- Interfaccia protettore --
PUNCH node to show protected area=COLPISCI il nodo per mostrare l'area protetta PUNCH node to show protected area=COLPISCI il nodo per mostrare l'area protetta
USE for area check=USA per controllare l'area USE for area check=USA per controllare l'area
Members:=Membri: Members:=Membri:
Close=Chiudi Close=Chiudi
Protection located at: @1=Protezione collocata a: @1 Protection located at: @1=Protezione collocata a: @1
Members: @1.=Membri: @1. Members: @1.=Membri: @1.
Allow faction access= Allow faction access=
This area is not protected.=Quest'area non è protetta. This area is not protected.=Quest'area non è protetta.
You can build here.=Qui puoi costruire. You can build here.=Qui puoi costruire.
Overlaps into above players protected area=Si sovrappone ad un'area sovrastante protetta dai giocatori Overlaps into above players protected area=Si sovrappone ad un'area sovrastante protetta dai giocatori
Protection Block=Blocco di protezione Protection Block=Blocco di protezione
Protection (owned by @1)=Protezione (di proprietà di @1) Protection (owned by @1)=Protezione (di proprietà di @1)
Protection Logo=Logo di protezione Protection Logo=Logo di protezione
[MOD] Protector Redo loaded=[MOD] Protector Redo caricato [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. 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 This area is owned by @1=Quest'area è di proprietà di @1
### hud.lua ### ### hud.lua ###
Owner: @1=Proprietario: @1 Owner: @1=Proprietario: @1
### tool.lua ### ### 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 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! Protector already in place!=Protettore già presente!
No protectors available to place!=Nessun protettore disponibile da posizionare! No protectors available to place!=Nessun protettore disponibile da posizionare!
Protector placed at @1=Protettore posizionato a @1 Protector placed at @1=Protettore posizionato a @1
Out of bounds!= Out of bounds!=
Cannot place protector, already protected at @1= Cannot place protector, already protected at @1=
Cannot place protector, container at @1= Cannot place protector, container at @1=
+61 -61
View File
@@ -1,62 +1,62 @@
# textdomain: protector # textdomain: protector
# author: SkyBuilder1717 # author: SkyBuilder1717
# last update: 2025/Jan/27 # last update: 2025/Jan/27
### admin.lua ### ### admin.lua ###
Remove Protectors around players (separate names with spaces)=Удалить Защитников вокруг игроков (отделяйте имена с помощью пробела) Remove Protectors around players (separate names with spaces)=Удалить Защитников вокруг игроков (отделяйте имена с помощью пробела)
<names list>=<игроки> <names list>=<игроки>
Replace Protector Owner with name provided=Заменить Владельца Защитника с доставленным именем Replace Protector Owner with name provided=Заменить Владельца Защитника с доставленным именем
<owner name> <name to replace with>=<владелец> <новый владелец> <owner name> <name to replace with>=<владелец> <новый владелец>
Replacing Protector name '@1' with '@2'=Замена Имени Защитника '@1' с '@2' Replacing Protector name '@1' with '@2'=Замена Имени Защитника '@1' с '@2'
Show protected areas of your nearby protectors=Показать защищённые зоны Защитниками с вами неподалёку Show protected areas of your nearby protectors=Показать защищённые зоны Защитниками с вами неподалёку
Protector Names to remove: @1=Имена Защитников чтобы удалить: @1 Protector Names to remove: @1=Имена Защитников чтобы удалить: @1
Name List Reset=Сброс Список Имён Name List Reset=Сброс Список Имён
Invalid player name!=Неправильное имя игрока! Invalid player name!=Неправильное имя игрока!
Player name too long=Имя игрока слишком длинное Player name too long=Имя игрока слишком длинное
Player not found.=Игрок не найден. Player not found.=Игрок не найден.
### doors_chest.lua ### ### doors_chest.lua ###
Protected Wooden Door=Защищённая Деревянная Дверь Protected Wooden Door=Защищённая Деревянная Дверь
Protected Steel Door=Защищённая Стальная Дверь Protected Steel Door=Защищённая Стальная Дверь
Protected Trapdoor=Защищённый Люк Protected Trapdoor=Защищённый Люк
Protected Steel Trapdoor=Защищённый Стальной Люк Protected Steel Trapdoor=Защищённый Стальной Люк
Protected Chest=Защищённый Сундук Protected Chest=Защищённый Сундук
To Chest=В Сундук To Chest=В Сундук
To Inventory=В Инвентарь To Inventory=В Инвентарь
Protected Chest (@1)=Защищённый Сундук (@1) Protected Chest (@1)=Защищённый Сундук (@1)
### init.lua ### ### init.lua ###
-- Protector interface --=-- Интерфейс Защитника -- -- Protector interface --=-- Интерфейс Защитника --
PUNCH node to show protected area=УДАРЬТЕ по блоку чтобы показать защищённую зону PUNCH node to show protected area=УДАРЬТЕ по блоку чтобы показать защищённую зону
USE for area check=ИСПОЛЬЗУЙТЕ для проверки зоны USE for area check=ИСПОЛЬЗУЙТЕ для проверки зоны
Members:=Участники: Members:=Участники:
Close=Закрыть Close=Закрыть
Allow faction access=Разрешить частичный доступ Allow faction access=Разрешить частичный доступ
Protection located at: @1=Защитник расположен на: @1 Protection located at: @1=Защитник расположен на: @1
Members: @1.=Участники: @1. Members: @1.=Участники: @1.
This area is not protected.=Эта зона не защищена. This area is not protected.=Эта зона не защищена.
You can build here.=Вы можете здесь строить. You can build here.=Вы можете здесь строить.
Overlaps into above players protected area=Перекрывает защищенную зону вышеперечисленных игроков Overlaps into above players protected area=Перекрывает защищенную зону вышеперечисленных игроков
Protection Block=Блок Защиты Protection Block=Блок Защиты
Protection (owned by @1)=Защита (владелец: @1) Protection (owned by @1)=Защита (владелец: @1)
Protection Logo=Логотип Защиты Protection Logo=Логотип Защиты
[MOD] Protector Redo loaded=[MOD] Protector Redo загружен [MOD] Protector Redo loaded=[MOD] Protector Redo загружен
Spawn @1 has been protected up to a @2 block radius.=Спавн @1 был защищён радиусом в блоках @2. Spawn @1 has been protected up to a @2 block radius.=Спавн @1 был защищён радиусом в блоках @2.
This area is owned by @1=Эта зона принадлежит @1. This area is owned by @1=Эта зона принадлежит @1.
### pvp.lua ### ### pvp.lua ###
[Protector] on_punchplayer called with nil objects=on_punchplayer вызван на нулевом объекте [Protector] on_punchplayer called with nil objects=on_punchplayer вызван на нулевом объекте
[Protector] pvp_protect not active, update your version of Luanti=[Protector] pvp_protect не активен, обновите версию Luanti [Protector] pvp_protect not active, update your version of Luanti=[Protector] pvp_protect не активен, обновите версию Luanti
[Protector] pvp_protect is disabled=[Protector] pvp_protect выключен [Protector] pvp_protect is disabled=[Protector] pvp_protect выключен
### hud.lua ### ### hud.lua ###
Owner: @1=Владелец: @1 Owner: @1=Владелец: @1
### tool.lua ### ### tool.lua ###
Protector Placer Tool (stand near protector, face direction and use)=Инструмент Размещения Защитника (встаньте рядом с Защитником, повернитесь к нему и используйте предмет) Protector Placer Tool (stand near protector, face direction and use)=Инструмент Размещения Защитника (встаньте рядом с Защитником, повернитесь к нему и используйте предмет)
Protector already in place!=Защитник уже стоит на этом месте! Protector already in place!=Защитник уже стоит на этом месте!
No protectors available to place!=Нет доступных Защитников чтобы поставить! No protectors available to place!=Нет доступных Защитников чтобы поставить!
Out of bounds!=За пределами! Out of bounds!=За пределами!
Protector placed at @1=Защитник размещён на @1 Protector placed at @1=Защитник размещён на @1
Cannot place protector, already protected at @1=Нельзя поставить Защитник, другой Защитник уже на @1 Cannot place protector, already protected at @1=Нельзя поставить Защитник, другой Защитник уже на @1
Cannot place protector, container at @1=Нельзя поставить Защитник, контейнер на @1 Cannot place protector, container at @1=Нельзя поставить Защитник, контейнер на @1
+56 -56
View File
@@ -1,57 +1,57 @@
# textdomain: protector # textdomain: protector
# author: CodeXP and TenPlus1 # author: CodeXP and TenPlus1
# last update: 2020/Jul/12 # last update: 2020/Jul/12
### admin.lua ### ### admin.lua ###
Remove Protectors around players (separate names with spaces)=Ismi verilen oyuncuların yanındaki korumaları kaldır. (İsimleri boşlukla ayır) 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> <names list>=<isim listesi>
Replace Protector Owner with name provided=Koruyucu Sahibini belirtilen adla değiştirin 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> <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 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 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 Protector Names to remove: @1=Silinecek korumaların isimleri: @1
Name List Reset=İsim listesini sıfırla Name List Reset=İsim listesini sıfırla
Invalid player name!= Invalid player name!=
Player name too long= Player name too long=
Player not found.= Player not found.=
### doors_chest.lua ### ### doors_chest.lua ###
Protected Wooden Door=Korumalı ahşap kapı Protected Wooden Door=Korumalı ahşap kapı
Protected Steel Door=Korumalı çelik kapı Protected Steel Door=Korumalı çelik kapı
Protected Trapdoor=Korumalı tuzak kapısı Protected Trapdoor=Korumalı tuzak kapısı
Protected Steel Trapdoor=Korumalı çelik tuzak kapısı Protected Steel Trapdoor=Korumalı çelik tuzak kapısı
Protected Chest=Korumalı sandık Protected Chest=Korumalı sandık
To Chest=Sandığa To Chest=Sandığa
To Inventory=Envantere To Inventory=Envantere
Protected Chest (@1)=Korumalı sandık (@1) Protected Chest (@1)=Korumalı sandık (@1)
### init.lua ### ### init.lua ###
-- Protector interface --=-- Koruyucu arayüz -- -- Protector interface --=-- Koruyucu arayüz --
PUNCH node to show protected area=Korunan alanı göstermek için yumruk PUNCH node to show protected area=Korunan alanı göstermek için yumruk
USE for area check=Bölge kontrolü için kullan USE for area check=Bölge kontrolü için kullan
Members:=Üyeler Members:=Üyeler
Close=Kapat Close=Kapat
Protection located at: @1=Korumanın bulunduğu yer @1 Protection located at: @1=Korumanın bulunduğu yer @1
Members: @1.=Üyeler @1. Members: @1.=Üyeler @1.
Allow faction access= Allow faction access=
This area is not protected.=Bu alan korumalı değildir. This area is not protected.=Bu alan korumalı değildir.
You can build here.=Buraya inşaa edebilirsiniz. You can build here.=Buraya inşaa edebilirsiniz.
Overlaps into above players protected area=Yukarıdaki oyuncuların koruma alanı ile çakışıyor Overlaps into above players protected area=Yukarıdaki oyuncuların koruma alanı ile çakışıyor
Protection Block=Koruma kutusu Protection Block=Koruma kutusu
Protection (owned by @1)=Koruma (@1 sahibidir) Protection (owned by @1)=Koruma (@1 sahibidir)
Protection Logo=Koruma arması Protection Logo=Koruma arması
[MOD] Protector Redo loaded=[MOD] Protector Redo yüklendi [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. 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! This area is owned by @1=Burasının sahibi @1!
### hud.lua ### ### hud.lua ###
Owner: @1=Sahip: @1 Owner: @1=Sahip: @1
### tool.lua ### ### 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 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! Protector already in place!=Koruyucu zaten yerinde!
No protectors available to place!=Yerleştirilecek koruyucu yok! No protectors available to place!=Yerleştirilecek koruyucu yok!
Protector placed at @1=Korumanın bulunduğu yer @1 Protector placed at @1=Korumanın bulunduğu yer @1
Out of bounds!= Out of bounds!=
Cannot place protector, already protected at @1= Cannot place protector, already protected at @1=
Cannot place protector, container at @1= Cannot place protector, container at @1=
+56 -56
View File
@@ -1,56 +1,56 @@
# textdomain: protector # textdomain: protector
Protector Redo=Захист Protector Redo=Захист
Lets players craft special blocks to protect their builds or disable PVP in areas.=Дозволяє гравцям створювати спеціальні блоки для захисту їхніх споруд або вимкнення PVP на певних територіях. Lets players craft special blocks to protect their builds or disable PVP in areas.=Дозволяє гравцям створювати спеціальні блоки для захисту їхніх споруд або вимкнення PVP на певних територіях.
### admin.lua ### ### admin.lua ###
Remove Protectors around players (separate names with spaces)=Видалити захист поряд із гравцями (перечислити імена, розділяючи пробілами) Remove Protectors around players (separate names with spaces)=Видалити захист поряд із гравцями (перечислити імена, розділяючи пробілами)
<names list>=<список імен> <names list>=<список імен>
Replace Protector Owner with name provided=Замінити власника захисту новим власником Replace Protector Owner with name provided=Замінити власника захисту новим власником
<owner name> <name to replace with>=<ім'я власника> <ім'я нового власника> <owner name> <name to replace with>=<ім'я власника> <ім'я нового власника>
Replacing Protector name '@1' with '@2'=Заміняється власник захисту із '@1' на '@2' Replacing Protector name '@1' with '@2'=Заміняється власник захисту із '@1' на '@2'
Show protected areas of your nearby protectors=Показати найближчі захищені території Show protected areas of your nearby protectors=Показати найближчі захищені території
Protector Names to remove: @1=Імена, які будуть видалені: @1 Protector Names to remove: @1=Імена, які будуть видалені: @1
Name List Reset=Очистити список імен Name List Reset=Очистити список імен
### doors_chest.lua ### ### doors_chest.lua ###
Protected Wooden Door=Захищені дерев'яні двері Protected Wooden Door=Захищені дерев'яні двері
Protected Steel Door=Захищені сталеві двері Protected Steel Door=Захищені сталеві двері
Protected Trapdoor=Захищений дерев'яний люк Protected Trapdoor=Захищений дерев'яний люк
Protected Steel Trapdoor=Захищений сталевий люк Protected Steel Trapdoor=Захищений сталевий люк
Protected Chest=Захищена скриня Protected Chest=Захищена скриня
To Chest=В скриню To Chest=В скриню
To Inventory=В інвентар To Inventory=В інвентар
Protected Chest (@1)=Захищена скриня (@1) Protected Chest (@1)=Захищена скриня (@1)
### init.lua ### ### init.lua ###
-- Protector interface --=-- Налаштування захисту -- -- Protector interface --=-- Налаштування захисту --
PUNCH node to show protected area=ВДАРИТИ блок для підсвітки захищеної території PUNCH node to show protected area=ВДАРИТИ блок для підсвітки захищеної території
USE for area check=ЛКМ для перевірки захищеної території USE for area check=ЛКМ для перевірки захищеної території
Members:=Учасники: Members:=Учасники:
Close=Закрити Close=Закрити
Protection located at: @1=Захист знаходиться на координатах: @1 Protection located at: @1=Захист знаходиться на координатах: @1
Members: @1.=Учасники: @1. Members: @1.=Учасники: @1.
This area is not protected.=Територія вільна. This area is not protected.=Територія вільна.
You can build here.=Тут можна будувати. You can build here.=Тут можна будувати.
Overlaps into above players protected area=Блок захисту не може бути встановлений тут, десь поруч є територія іншого гравця Overlaps into above players protected area=Блок захисту не може бути встановлений тут, десь поруч є територія іншого гравця
Protection Block=Блок захисту території Protection Block=Блок захисту території
Protection (owned by @1)=Захист території гравця @1 Protection (owned by @1)=Захист території гравця @1
Protection Logo=Захисний знак Protection Logo=Захисний знак
[MOD] Protector Redo loaded=[МОД] Protector Redo завантажено [MOD] Protector Redo loaded=[МОД] Protector Redo завантажено
Spawn @1 has been protected up to a @2 block radius.=Спавн @1 захищений у радіусі @2 блока. Spawn @1 has been protected up to a @2 block radius.=Спавн @1 захищений у радіусі @2 блока.
This area is owned by @1=Ця територія належить гравцю @1 This area is owned by @1=Ця територія належить гравцю @1
### pvp.lua ### ### pvp.lua ###
[Protector] on_punchplayer called with nil objects=[Захист] on_punchplayer викликана із нульовими об'єктами [Protector] on_punchplayer called with nil objects=[Захист] on_punchplayer викликана із нульовими об'єктами
[Protector] pvp_protect not active, update your version of Minetest=[Захист] pvp_protect неактивний, оновіть версію Luanti [Protector] pvp_protect not active, update your version of Minetest=[Захист] pvp_protect неактивний, оновіть версію Luanti
[Protector] pvp_protect is disabled=[Защита] pvp_protect вимкнений [Protector] pvp_protect is disabled=[Защита] pvp_protect вимкнений
### hud.lua ### ### hud.lua ###
Owner: @1=Територія належить @1 Owner: @1=Територія належить @1
### tool.lua ### ### tool.lua ###
Protector Placer Tool (stand near protector, face direction and use)=Інструмент встановлення захисту (встаньте поруч із захистом, поверніться в потрібному напрямку і використайте) Protector Placer Tool (stand near protector, face direction and use)=Інструмент встановлення захисту (встаньте поруч із захистом, поверніться в потрібному напрямку і використайте)
Protector already in place!=Захист уже встановлено! Protector already in place!=Захист уже встановлено!
No protectors available to place!=У вас немає блоків захисту території в інвентарю! No protectors available to place!=У вас немає блоків захисту території в інвентарю!
Protector placed at @1=Захист знаходиться на координатах @1 Protector placed at @1=Захист знаходиться на координатах @1
+59 -59
View File
@@ -1,59 +1,59 @@
# textdomain: protector # textdomain: protector
# author: ? # author: ?
# last update: 2020/Jul/12 # last update: 2020/Jul/12
### admin.lua ### ### admin.lua ###
Remove Protectors around players (separate names with spaces)= Remove Protectors around players (separate names with spaces)=
<names list>= <names list>=
Replace Protector Owner with name provided= Replace Protector Owner with name provided=
<owner name> <name to replace with>= <owner name> <name to replace with>=
Replacing Protector name '@1' with '@2'= Replacing Protector name '@1' with '@2'=
Show protected areas of your nearby protectors= Show protected areas of your nearby protectors=
Protector Names to remove: @1= Protector Names to remove: @1=
Name List Reset= Name List Reset=
Invalid player name!= Invalid player name!=
Player name too long= Player name too long=
Player not found.= Player not found.=
### doors_chest.lua ### ### doors_chest.lua ###
Protected Wooden Door= Protected Wooden Door=
Protected Steel Door= Protected Steel Door=
Protected Trapdoor= Protected Trapdoor=
Protected Steel Trapdoor= Protected Steel Trapdoor=
Protected Chest= Protected Chest=
To Chest= To Chest=
To Inventory= To Inventory=
Protected Chest (@1)= Protected Chest (@1)=
### init.lua ### ### init.lua ###
-- Protector interface --= -- Protector interface --=
PUNCH node to show protected area= PUNCH node to show protected area=
USE for area check= USE for area check=
Members:= Members:=
Close= Close=
Protection located at: @1= Protection located at: @1=
Members: @1.= Members: @1.=
Allow faction access= Allow faction access=
This area is not protected.= This area is not protected.=
You can build here.= You can build here.=
Overlaps into above players protected area= Overlaps into above players protected area=
Protection Block= Protection Block=
Protection (owned by @1)= Protection (owned by @1)=
Protection Logo= Protection Logo=
[MOD] Protector Redo loaded= [MOD] Protector Redo loaded=
Spawn @1 has been protected up to a @2 block radius.= Spawn @1 has been protected up to a @2 block radius.=
This area is owned by @1= This area is owned by @1=
Add member names to local protection Add member names to local protection
Remove member names from local protection Remove member names from local protection
### hud.lua ### ### hud.lua ###
Owner: @1= Owner: @1=
### tool.lua ### ### tool.lua ###
Protector Placer Tool (stand near protector, face direction and use)= Protector Placer Tool (stand near protector, face direction and use)=
Protector already in place!= Protector already in place!=
Out of bounds!= Out of bounds!=
No protectors available to place!= No protectors available to place!=
Protector placed at @1= Protector placed at @1=
Cannot place protector, already protected at @1= Cannot place protector, already protected at @1=
Cannot place protector, container at @1= Cannot place protector, container at @1=
+15 -15
View File
@@ -1,15 +1,15 @@
-- add lucky blocks -- add lucky blocks
lucky_block:add_blocks({ lucky_block:add_blocks({
{"dro", {"protector:protect"}, 2}, {"dro", {"protector:protect"}, 2},
{"dro", {"protector:protect2"}, 2}, {"dro", {"protector:protect2"}, 2},
{"dro", {"protector:door_wood"}, 2}, {"dro", {"protector:door_wood"}, 2},
{"dro", {"protector:door_steel"}, 2}, {"dro", {"protector:door_steel"}, 2},
{"exp", 5, true}, {"exp", 5, true},
{"dro", {"protector:trapdoor"}, 2}, {"dro", {"protector:trapdoor"}, 2},
{"dro", {"protector:trapdoor_steel"}, 2}, {"dro", {"protector:trapdoor_steel"}, 2},
{"dro", {"protector:tool"}, 1}, {"dro", {"protector:tool"}, 1},
{"dro", {"protector:chest"}, 1}, {"dro", {"protector:chest"}, 1},
{"exp"} {"exp"}
}) })
+4 -4
View File
@@ -1,4 +1,4 @@
name = protector name = protector
description = Lets players craft special blocks to protect their builds or disable PVP in areas. description = Lets players craft special blocks to protect their builds or disable PVP in areas.
optional_depends = default, lucky_block, mesecons_mvps, playerfactions, mcl_core, mcl_formspec, mcl_sounds optional_depends = default, lucky_block, mesecons_mvps, playerfactions, mcl_core, mcl_formspec, mcl_sounds
min_minetest_version = 5.0 min_minetest_version = 5.0
+70 -70
View File
@@ -1,70 +1,70 @@
-- get static spawn position -- get static spawn position
local statspawn = core.string_to_pos(core.settings:get("static_spawnpoint")) local statspawn = core.string_to_pos(core.settings:get("static_spawnpoint"))
or {x = 0, y = 2, z = 0} or {x = 0, y = 2, z = 0}
-- is spawn protected -- is spawn protected
local protector_spawn = tonumber(core.settings:get("protector_spawn") local protector_spawn = tonumber(core.settings:get("protector_spawn")
or core.settings:get("protector_pvp_spawn")) or 0 or core.settings:get("protector_pvp_spawn")) or 0
-- is night-only pvp enabled -- is night-only pvp enabled
local protector_night_pvp = core.settings:get_bool("protector_night_pvp") local protector_night_pvp = core.settings:get_bool("protector_night_pvp")
-- disables PVP in your own protected areas -- disables PVP in your own protected areas
if core.settings:get_bool("enable_pvp") if core.settings:get_bool("enable_pvp")
and core.settings:get_bool("protector_pvp") then and core.settings:get_bool("protector_pvp") then
if core.register_on_punchplayer then if core.register_on_punchplayer then
core.register_on_punchplayer(function(player, hitter, core.register_on_punchplayer(function(player, hitter,
time_from_last_punch, tool_capabilities, dir, damage) time_from_last_punch, tool_capabilities, dir, damage)
if not player or not hitter then if not player or not hitter then
print("[MOD] Protector - on_punchplayer called with nil objects") print("[MOD] Protector - on_punchplayer called with nil objects")
return false return false
end end
if not hitter:is_player() then return false end if not hitter:is_player() then return false end
-- no pvp at spawn area -- no pvp at spawn area
local pos = player:get_pos() local pos = player:get_pos()
if pos.x < statspawn.x + protector_spawn if pos.x < statspawn.x + protector_spawn
and 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.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
and pos.z > statspawn.z - protector_spawn then and pos.z > statspawn.z - protector_spawn then
return true return true
end end
-- do we enable pvp at night time only ? -- do we enable pvp at night time only ?
if protector_night_pvp then if protector_night_pvp then
-- get time of day -- get time of day
local tod = core.get_timeofday() or 0 local tod = core.get_timeofday() or 0
if tod > 0.2 and tod < 0.8 then if tod > 0.2 and tod < 0.8 then
-- --
else else
return false return false
end end
end end
-- is player being punched inside a protected area ? -- is player being punched inside a protected area ?
if core.is_protected(pos, hitter:get_player_name()) then if core.is_protected(pos, hitter:get_player_name()) then
return true return true
end end
return false return false
end) end)
else else
print("[MOD] Protector - pvp_protect not active, update your version of Minetest") print("[MOD] Protector - pvp_protect not active, update your version of Minetest")
end end
else else
print("[MOD] Protector - pvp_protect is disabled") print("[MOD] Protector - pvp_protect is disabled")
end end
+35 -35
View File
@@ -1,35 +1,35 @@
# Size of protected area around protection node limiting player interaction # Length of protected cube from the corner of the protection node
protector_radius (Protector Radius [max 30]) int 5 protector_length (Protector Length [max 60]) int 15
# Flips player around when accessing protected area to stop lag griefing # Flips player around when accessing protected area to stop lag griefing
protector_flip (Protector Flip) bool false protector_flip (Protector Flip) bool false
# Hurts player by amount entered when accessing protected area, 0 to disable # Hurts player by amount entered when accessing protected area, 0 to disable
protector_hurt (Protector Hurt) int 0 protector_hurt (Protector Hurt) int 0
# Sets a protected area around spawn by node radius given # Sets a protected area around spawn by node radius given
protector_spawn (Protector Spawn) int 0 protector_spawn (Protector Spawn) int 0
# Enables PVP inside of protected areas # Enables PVP inside of protected areas
protector_pvp (Protector PVP) bool false protector_pvp (Protector PVP) bool false
# When true will allow PVP inside protected spawn area # When true will allow PVP inside protected spawn area
protector_pvp_spawn (Protector PVP Spawn) int 0 protector_pvp_spawn (Protector PVP Spawn) int 0
# When true will allow PVP inside all protected areas at night time only # When true will allow PVP inside all protected areas at night time only
protector_night_pvp (Protector Night PVP) bool false protector_night_pvp (Protector Night PVP) bool false
# Interval in seconds that protection field is shown # Interval in seconds that protection field is shown
protector_show_interval (Protector Show Interval) int 5 protector_show_interval (Protector Show Interval) int 5
# Interval in seconds that HUD ownership text is updated, 0 to disable # Interval in seconds that HUD ownership text is updated, 0 to disable
protector_hud_interval (Protector HUD Interval) int 5 protector_hud_interval (Protector HUD Interval) int 5
# Enables craft recipe for protection block # Enables craft recipe for protection block
protector_recipe (Enable Protector recipe) bool true protector_recipe (Enable Protector recipe) bool true
# Enables craft recipes for protected doors and chest # Enables craft recipes for protected doors and chest
protector_crafts (Enable Protector door/chest recipes) bool true protector_crafts (Enable Protector door/chest recipes) bool true
# Enables protection messages in player chat # Enables protection messages in player chat
protector_msg (Enable Protector Messages) bool true protector_msg (Enable Protector Messages) bool true
+34 -34
View File
@@ -1,34 +1,34 @@
following Textures created by Fernando Zapata (CC BY-SA 3.0): following Textures created by Fernando Zapata (CC BY-SA 3.0):
doors_wood.png doors_wood.png
doors_wood_a.png doors_wood_a.png
doors_wood_b.png doors_wood_b.png
doors_brown.png doors_brown.png
following Textures created by BlockMen (WTFPL): following Textures created by BlockMen (WTFPL):
doors_trapdoor.png doors_trapdoor.png
following textures created by celeron55 (CC BY-SA 3.0): following textures created by celeron55 (CC BY-SA 3.0):
doors_trapdoor_side.png doors_trapdoor_side.png
following textures created by PilzAdam (WTFPL): following textures created by PilzAdam (WTFPL):
doors_steel.png doors_steel.png
doors_steel_a.png doors_steel_a.png
doors_steel_b.png doors_steel_b.png
doors_grey.png doors_grey.png
doors_trapdoor_steel.png doors_trapdoor_steel.png
doors_trapdoor_steel_side.png doors_trapdoor_steel_side.png
following textures by Cisoun (WTFPL): following textures by Cisoun (WTFPL):
default_chest_front.png default_chest_front.png
default_chest_side.png default_chest_side.png
default_chest_top.png default_chest_top.png
following textures by TenPlus1 (CC BY-SA 3.0): following textures by TenPlus1 (CC BY-SA 3.0):
protector_logo.png protector_logo.png
protector_display.png protector_display.png
protector_overlay.png protector_overlay.png
following textures by Kilbith (CC BY-SA 3.0): following textures by Kilbith (CC BY-SA 3.0):
protector_up_icon.png protector_up_icon.png
protector_down_icon.png (both rotated) protector_down_icon.png (both rotated)
+173 -168
View File
@@ -1,168 +1,173 @@
-- protector placement tool (thanks to Shara for code and idea) -- protector placement tool (thanks to Shara for code and idea)
local S = core.get_translator("protector") local S = core.get_translator("protector")
-- get protection radius -- get protection length
local r = protector.radius local r = protector.length
-- protector placement tool -- protector placement tool
core.register_craftitem("protector:tool", { core.register_craftitem("protector:tool", {
description = S("Protector Placer Tool (stand near protector, face direction and use)"), description = S("Protector Placer Tool (stand near protector, face direction and use)"),
inventory_image = "protector_tool.png", inventory_image = "protector_tool.png",
stack_max = 1, stack_max = 1,
on_use = function(itemstack, user, pointed_thing) on_use = function(itemstack, user, pointed_thing)
local name = user:get_player_name() local name = user:get_player_name()
-- check for protector near player (2 block radius) -- check for protector near player (2 block search)
local pos = user:get_pos() local pos = user:get_pos()
local pp = core.find_nodes_in_area( local pp = core.find_nodes_in_area(
vector.subtract(pos, 2), vector.add(pos, 2), vector.subtract(pos, 2), vector.add(pos, 2),
{"protector:protect", "protector:protect2", "protector:protect_hidden"}) {"protector:protect", "protector:protect2", "protector:protect_hidden"})
if #pp == 0 then return end -- none found if #pp == 0 then return end -- none found
pos = pp[1] -- take position of first protector found pos = pp[1] -- take position of first protector found
-- get members on protector -- get members on protector
local meta = core.get_meta(pos) local meta = core.get_meta(pos)
local members = meta:get_string("members") or "" local members = meta:get_string("members") or ""
local factions = meta:get_string("factions") or "" local factions = meta:get_string("factions") or ""
-- get direction player is facing -- get direction player is facing
local dir = core.dir_to_facedir( user:get_look_dir() ) local dir = core.dir_to_facedir( user:get_look_dir() )
local vec = {x = 0, y = 0, z = 0} local vec = {x = 0, y = 0, z = 0}
local gap = (r * 2) + 1 local gap = r + 1
local pit = user:get_look_vertical() local pit = user:get_look_vertical()
-- set placement coords -- set placement coords
if pit > 1.2 then vec.y = -gap -- up if pit > 1.2 then vec.y = -gap -- up
elseif pit < -1.2 then vec.y = gap -- down elseif pit < -1.2 then vec.y = gap -- down
elseif dir == 0 then vec.z = gap -- north elseif dir == 0 then vec.z = gap -- north
elseif dir == 1 then vec.x = gap -- east elseif dir == 1 then vec.x = gap -- east
elseif dir == 2 then vec.z = -gap -- south elseif dir == 2 then vec.z = -gap -- south
elseif dir == 3 then vec.x = -gap -- west elseif dir == 3 then vec.x = -gap -- west
end end
-- new position -- new position
pos.x = pos.x + vec.x pos.x = pos.x + vec.x
pos.y = pos.y + vec.y pos.y = pos.y + vec.y
pos.z = pos.z + vec.z pos.z = pos.z + vec.z
-- does placing a protector overlap existing area -- does placing a protector overlap existing area
if not protector.can_dig(r * 2, pos, user:get_player_name(), true, 3) then local ov = core.find_nodes_in_area(
{x = pos.x - r, y = pos.y - r, z = pos.z - r},
core.chat_send_player(name, {x = pos.x + r, y = pos.y + r, z = pos.z + r},
S("Overlaps into above players protected area")) {"protector:protect", "protector:protect2", "protector:protect_hidden"})
return for _, npos in ipairs(ov) do
end if core.get_meta(npos):get_string("owner") ~= name then
core.chat_send_player(name,
-- does a protector already exist ? S("Overlaps into above players protected area"))
if #core.find_nodes_in_area(pos, pos, return
{"protector:protect", "protector:protect2", end
"protector:protect_hidden"}) > 0 then end
core.chat_send_player(name, S("Protector already in place!")) -- does a protector already exist ?
if #core.find_nodes_in_area(pos, pos,
return {"protector:protect", "protector:protect2",
end "protector:protect_hidden"}) > 0 then
-- do not place protector out of map bounds or replace bedrock core.chat_send_player(name, S("Protector already in place!"))
if #core.find_nodes_in_area(pos, pos, {"ignore", "mcl_core:bedrock"}) > 0 then
return
core.chat_send_player(name, S("Out of bounds!")) end
return -- do not place protector out of map bounds or replace bedrock
end if #core.find_nodes_in_area(pos, pos, {"ignore", "mcl_core:bedrock"}) > 0 then
-- do we have protectors to use ? core.chat_send_player(name, S("Out of bounds!"))
local nod
local inv = user:get_inventory() return
end
if not inv:contains_item("main", "protector:protect")
and not inv:contains_item("main", "protector:protect2") then -- do we have protectors to use ?
local nod
core.chat_send_player(name, local inv = user:get_inventory()
S("No protectors available to place!"))
if not inv:contains_item("main", "protector:protect")
return and not inv:contains_item("main", "protector:protect2") then
end
core.chat_send_player(name,
-- take protector (block first then logo) S("No protectors available to place!"))
if inv:contains_item("main", "protector:protect") then
return
inv:remove_item("main", "protector:protect") end
nod = "protector:protect" -- take protector (block first then logo)
if inv:contains_item("main", "protector:protect") then
elseif inv:contains_item("main", "protector:protect2") then
inv:remove_item("main", "protector:protect")
inv:remove_item("main", "protector:protect2")
nod = "protector:protect"
nod = "protector:protect2"
end elseif inv:contains_item("main", "protector:protect2") then
-- do not replace containers with inventory space inv:remove_item("main", "protector:protect2")
local inv = core.get_inventory({type = "node", pos = pos})
nod = "protector:protect2"
if inv then end
core.chat_send_player(name,
S("Cannot place protector, container at @1", -- do not replace containers with inventory space
core.pos_to_string(pos))) local inv = core.get_inventory({type = "node", pos = pos})
return
end if inv then
core.chat_send_player(name,
-- protection check for other mods like Areas S("Cannot place protector, container at @1",
if core.is_protected(pos, name) then core.pos_to_string(pos)))
return
core.chat_send_player(name, end
S("Cannot place protector, already protected at @1",
core.pos_to_string(pos))) -- protection check for other mods like Areas
return if core.is_protected(pos, name) then
end
core.chat_send_player(name,
-- place protector S("Cannot place protector, already protected at @1",
core.set_node(pos, {name = nod, param2 = 1}) core.pos_to_string(pos)))
return
-- set protector metadata end
local meta = core.get_meta(pos)
-- place protector
meta:set_string("owner", name) core.set_node(pos, {name = nod, param2 = 1})
meta:set_string("infotext", "Protection (owned by " .. name .. ")")
-- set protector metadata
-- copy members across if holding sneak when using tool local meta = core.get_meta(pos)
if user:get_player_control().sneak then
meta:set_string("members", members) meta:set_string("owner", name)
meta:set_string("factions", factions) meta:set_string("infotext", "Protection (owned by " .. name .. ")")
else
meta:set_string("members", "") -- copy members across if holding sneak when using tool
end if user:get_player_control().sneak then
meta:set_string("members", members)
core.add_entity(pos, "protector:display") meta:set_string("factions", factions)
else
core.chat_send_player(name, meta:set_string("members", "")
S("Protector placed at @1", core.pos_to_string(pos))) end
end
}) core.add_entity({x=pos.x+r/2, y=pos.y+r/2, z=pos.z+r/2}, "protector:display")
-- tool recipe core.chat_send_player(name,
S("Protector placed at @1", core.pos_to_string(pos)))
local df = "default:steel_ingot" end
})
if core.get_modpath("mcl_core") then
df = "mcl_core:iron_ingot" -- tool recipe
end
local df = "default:steel_ingot"
core.register_craft({
output = "protector:tool", if core.get_modpath("mcl_core") then
recipe = { df = "mcl_core:iron_ingot"
{df, df, df}, end
{df, "protector:protect", df},
{df, df, df} core.register_craft({
} output = "protector:tool",
}) recipe = {
{df, df, df},
{df, "protector:protect", df},
{df, df, df}
}
})