Add the whole mod

This commit is contained in:
Panquesito7 2019-08-15 18:58:01 -05:00 committed by GitHub
parent 54b5ef9e77
commit ff78051f76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 2344 additions and 0 deletions

146
functions.lua Normal file
View File

@ -0,0 +1,146 @@
--[[
Re-write functions (from builtin commands).
Copyright (C) 2019 Panquesito7
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
--]]
local S = enhanced_builtin_commands.intllib
function enhanced_builtin_commands.grant_command(caller, grantname, grantprivstr)
local caller_privs = core.get_player_privs(caller)
if not (caller_privs.privs or caller_privs.basic_privs) then
return false, S("Your privileges are insufficient.")
end
if not core.get_auth_handler().get_auth(grantname) then
return false, S("Player @1 does not exist.", grantname)
end
local grantprivs = core.string_to_privs(grantprivstr)
if grantprivstr == "all" then
grantprivs = core.registered_privileges
end
local privs = core.get_player_privs(grantname)
local privs_unknown = ""
local basic_privs =
core.string_to_privs(core.settings:get("basic_privs") or "interact,shout")
for priv, _ in pairs(grantprivs) do
if not basic_privs[priv] and not caller_privs.privs then
return false, S("Your privileges are insufficient.")
end
if not core.registered_privileges[priv] then
privs_unknown = privs_unknown .. S("Unknown privilege: @1\n", priv)
end
privs[priv] = true
end
if privs_unknown ~= "" then
return false, privs_unknown
end
for priv, _ in pairs(grantprivs) do
core.run_priv_callbacks(grantname, priv, caller, "grant")
end
core.set_player_privs(grantname, privs)
core.log("action", caller..' granted ('..core.privs_to_string(grantprivs, ', ')..') privileges to '..grantname)
if grantname ~= caller then
core.chat_send_player(grantname, S("@1 granted you privileges: @2", caller, core.privs_to_string(grantprivs, ' ')))
end
return true, S("Privileges of @1: @2", grantname, core.privs_to_string(core.get_player_privs(grantname), ' '))
end
function enhanced_builtin_commands.emergeblocks_callback(pos, action, num_calls_remaining, ctx)
if ctx.total_blocks == 0 then
ctx.total_blocks = num_calls_remaining + 1
ctx.current_blocks = 0
end
ctx.current_blocks = ctx.current_blocks + 1
if ctx.current_blocks == ctx.total_blocks then
core.chat_send_player(ctx.requestor_name,
string.format(S("Finished emerging %d blocks in %.2fms.",
ctx.total_blocks, (os.clock() - ctx.start_time) * 1000)))
end
end
function enhanced_builtin_commands.emergeblocks_progress_update(ctx)
if ctx.current_blocks ~= ctx.total_blocks then
core.chat_send_player(ctx.requestor_name,
string.format(S("emergeblocks update: %d/%d blocks emerged (%.1f%%)",
ctx.current_blocks, ctx.total_blocks,
(ctx.current_blocks / ctx.total_blocks) * 100)))
core.after(2, emergeblocks_progress_update, ctx)
end
end
function enhanced_builtin_commands.handle_give_command(cmd, giver, receiver, stackstring)
core.log("action", giver .. " invoked " .. cmd
.. ', stackstring="' .. stackstring .. '"')
local itemstack = ItemStack(stackstring)
if itemstack:is_empty() then
return false, S("Cannot give an empty item")
elseif (not itemstack:is_known()) or (itemstack:get_name() == "unknown") then
return false, S("Cannot give an unknown item")
-- Forbid giving 'ignore' due to unwanted side effects
elseif itemstack:get_name() == "ignore" then
return false, S("Giving 'ignore' is not allowed")
end
local receiverref = core.get_player_by_name(receiver)
if receiverref == nil then
return false, S("@1 is not a known player", receiver)
end
local leftover = receiverref:get_inventory():add_item("main", itemstack)
local partiality
if leftover:is_empty() then
partiality = ""
elseif leftover:get_count() == itemstack:get_count() then
partiality = S("could not be ")
else
partiality = S("partially ")
end
-- The actual item stack string may be different from what the "giver"
-- entered (e.g. big numbers are always interpreted as 2^16-1).
stackstring = itemstack:to_string()
if giver == receiver then
local msg = S("%q %sadded to inventory.")
return true, msg:format(stackstring, partiality)
else
core.chat_send_player(receiver, S("%q %sadded to inventory.", format(stackstring, partiality)))
local msg = S("%q %sadded to %s's inventory.")
return true, msg:format(stackstring, partiality, receiver)
end
end
function enhanced_builtin_commands.handle_kill_command(killer, victim)
if core.settings:get_bool("enable_damage") == false then
return false, S("Players can't be killed, damage has been disabled.")
end
local victimref = core.get_player_by_name(victim)
if victimref == nil then
return false, S("Player @1 is not online.", victim)
elseif victimref:get_hp() <= 0 then
if killer == victim then
return false, S("You are already dead.")
else
return false, S("@1 is already dead.", victim)
end
end
if not killer == victim then
core.log("action", string.format("%s killed %s", killer, victim))
end
-- Kill victim
victimref:set_hp(0)
return true, S("@1 has been killed.", victim)
end

852
init.lua Normal file
View File

@ -0,0 +1,852 @@
--[[
A mod that enhances the builtin commands (adds support for intllib, and adds features to some commands).
Copyright (C) 2019 Panquesito7
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
--]]
-- Load support for intllib.
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
enhanced_builtin_commands = {
intllib = S
}
dofile(MP.."/functions.lua")
core.override_chatcommand("admin", {
description = S("Show the name of the server owner"),
params = S("<playername>"),
func = function(name, param)
local admin = core.settings:get("name")
if admin and param == "" then
return true, S("The administrator of this server is @1.", admin)
elseif not admin then
if param ~= "" then
core.chat_send_player(param, S("There's no administrator named in the config file."))
end
return false, S("There's no administrator named in the config file.")
elseif core.check_player_privs(name, {server = true}) then
core.chat_send_player(param, S("The administrator of this server is @1.", admin))
core.chat_send_player(name, S("Sent to @1.", param))
else
return false, S("You don't have permission to run this command (missing privilege: server).")
end
end,
})
core.override_chatcommand("mods", {
params = S("<playername>"),
description = S("List mods installed on the server."),
privs = {},
func = function(name, param)
if param == "" then
return true, table.concat(minetest.get_modnames(), ", ")
elseif core.check_player_privs(name, {server = true}) then
core.chat_send_player(param, table.concat(minetest.get_modnames(), ", "))
core.chat_send_player(name, S("Sent to @1.", param))
else
return false, S("You don't have permission to run this command (missing privilege: server).")
end
end,
})
core.override_chatcommand("pulverize", {
params = S("<playername>"),
description = S("Destroy item in hand"),
func = function(name, param)
local player = core.get_player_by_name(name)
if not player then
core.log("error", "Unable to pulverize, no player.")
return false, S("Unable to pulverize, no player.")
end
local wielded_item = player:get_wielded_item()
--if wielded_item:is_empty() then
--return false, "Unable to pulverize, no item in hand."
--end
if param == "" then
if wielded_item:is_empty() then
return false, S("Unable to pulverize, no item in hand.")
end
core.log("action", name .. " pulverized \"" ..
wielded_item:get_name() .. " " .. wielded_item:get_count() .. "\"")
player:set_wielded_item(nil)
return true, S("An item was pulverized.")
elseif core.check_player_privs(name, {server = true}) then
if core.get_player_by_name(param):get_wielded_item():is_empty() then
core.chat_send_player(name, S("Unable to pulverize, no item in @1's hand.", param))
end
core.log("action", name .. " pulverized \"" ..
core.get_player_by_name(param):get_wielded_item():get_name() .. " " .. core.get_player_by_name(param):get_wielded_item():get_count() .. "\" from " .. param .. "")
if not core.get_player_by_name(param):get_wielded_item():is_empty() then
core.get_player_by_name(param):set_wielded_item(nil)
core.chat_send_player(param, S("An item was pulverized by @1.", name))
core.chat_send_player(name, "Sent to @1.", param)
end
else
return false, S("You don't have permission to run this command (missing privilege: server).")
end
end,
})
core.override_chatcommand("status", {
description = S("Show server status"),
params = S("<playername>"),
func = function(name, param)
local status = core.get_server_status(name, false)
if param == "" then
if status and status ~= "" then
return true, status
end
elseif core.check_player_privs(name, {server = true}) then
core.chat_send_player(param, core.get_server_status(param, false))
core.chat_send_player(name, "Sent to @1.", param)
elseif not status then
return false, S("This command was disabled by a mod or game")
else
return false, S("You don't have permission to run this command (missing privilege: server).")
end
end,
})
core.override_chatcommand("days", {
description = S("Show day count since world creation"),
func = function(name, param)
if param == "" then
return true, S("Current day is @1", core.get_day_count())
elseif core.check_player_privs(name, {server = true}) then
core.chat_send_player(param, "Current day is @1", core.get_day_count())
core.chat_send_player(name, "Sent to @1.", param)
else
return false, S("You don't have permission to run this command (missing privilege: server).")
end
end
})
core.override_chatcommand("me", {
params = S("<action>"),
description = S("Show chat action (e.g., '/me orders a pizza' displays '<player name> orders a pizza')"),
privs = {shout = true},
func = function(name, param)
core.chat_send_all("* " .. name .. " " .. param)
end,
})
core.override_chatcommand("privs", {
params = S("[<name>]"),
description = S("Show privileges of yourself or another player"),
func = function(caller, param)
param = param:trim()
local name = (param ~= "" and param or caller)
if not core.player_exists(name) then
return false, S("Player @1 does not exist.", name)
end
return true, S("Privileges of @1: @2", name, core.privs_to_string(core.get_player_privs(name)))
end,
})
core.override_chatcommand("haspriv", {
params = S("<privilege>"),
description = S("Return list of all online players with privilege."),
privs = {basic_privs = true},
func = function(caller, param)
param = param:trim()
if param == "" then
return false, S("Invalid parameters (see /help haspriv)")
end
if not core.registered_privileges[param] then
return false, S("Unknown privilege!")
end
local privs = core.string_to_privs(param)
local players_with_priv = {}
for _, player in pairs(core.get_connected_players()) do
local player_name = player:get_player_name()
if core.check_player_privs(player_name, privs) then
table.insert(players_with_priv, player_name)
end
end
return true, S("Players online with the '@1' privilege: @2", param, table.concat(players_with_priv, ", "))
end
})
core.override_chatcommand("grant", {
params = S("<name> (<privilege> | all)"),
description = S("Give privileges to player"),
func = function(name, param)
local grantname, grantprivstr = string.match(param, "([^ ]+) (.+)")
if not grantname or not grantprivstr then
return false, S("Invalid parameters (see /help grant)")
end
return enhanced_builtin_commands.grant_command(name, grantname, grantprivstr)
end,
})
core.override_chatcommand("grantme", {
params = S("<privilege> | all"),
description = S("Grant privileges to yourself"),
func = function(name, param)
if param == "" then
return false, S("Invalid parameters (see /help grantme)")
end
return enhanced_builtin_commands.grant_command(name, name, param)
end,
})
core.override_chatcommand("revoke", {
params = S("<name> (<privilege> | all)"),
description = S("Remove privileges from player"),
privs = {},
func = function(name, param)
if not core.check_player_privs(name, {privs=true}) and
not core.check_player_privs(name, {basic_privs=true}) then
return false, S("Your privileges are insufficient.")
end
local revoke_name, revoke_priv_str = string.match(param, "([^ ]+) (.+)")
if not revoke_name or not revoke_priv_str then
return false, S("Invalid parameters (see /help revoke)")
elseif not core.get_auth_handler().get_auth(revoke_name) then
return false, S("Player @1 does not exist.", revoke_name)
end
local revoke_privs = core.string_to_privs(revoke_priv_str)
local privs = core.get_player_privs(revoke_name)
local basic_privs =
core.string_to_privs(core.settings:get("basic_privs") or "interact,shout")
for priv, _ in pairs(revoke_privs) do
if not basic_privs[priv] and
not core.check_player_privs(name, {privs = true}) then
return false, S("Your privileges are insufficient.")
end
end
if revoke_priv_str == "all" then
revoke_privs = privs
privs = {}
else
for priv, _ in pairs(revoke_privs) do
privs[priv] = nil
end
end
for priv, _ in pairs(revoke_privs) do
core.run_priv_callbacks(revoke_name, priv, name, "revoke")
end
core.set_player_privs(revoke_name, privs)
core.log("action", name..' revoked ('
..core.privs_to_string(revoke_privs, ', ')
..') privileges from '..revoke_name)
if revoke_name ~= name then
core.chat_send_player(revoke_name, S("@1 revoked privileges from you: @2", name, core.privs_to_string(revoke_privs, ' ')))
end
return true, S("Privileges of @1: @2", revoke_name, core.privs_to_string(core.get_player_privs(revoke_name), ' '))
end,
})
core.override_chatcommand("setpassword", {
params = S("<name> <password>"),
description = S("Set player's password"),
privs = {password = true},
func = function(name, param)
local toname, raw_password = string.match(param, "^([^ ]+) +(.+)$")
if not toname then
toname = param:match("^([^ ]+) *$")
raw_password = nil
end
if not toname then
return false, S("Name field required")
end
local act_str_past = "?"
local act_str_pres = "?"
if not raw_password then
core.set_player_password(toname, "")
act_str_past = "cleared"
act_str_pres = "clears"
else
core.set_player_password(toname,
core.get_password_hash(toname,
raw_password))
act_str_past = "set"
act_str_pres = "sets"
end
if toname ~= name then
core.chat_send_player(toname, S("Your password was @1 by @2", act_str_past, name))
end
core.log("action", name .. " " .. act_str_pres
.. " password of " .. toname .. ".")
return true, S("Password of player \"@1\"@2 ", toname, act_str_past)
end,
})
core.override_chatcommand("clearpassword", {
params = S("<name>"),
description = S("Set empty password for a player"),
privs = {password = true},
func = function(name, param)
local toname = param
if toname == "" then
return false, S("Name field required")
end
core.set_player_password(toname, '')
core.log("action", name .. " clears password of " .. toname .. ".")
return true, S("Password of player \"@1\" cleared", toname)
end,
})
core.override_chatcommand("auth_reload", {
params = "",
description = S("Reload authentication data"),
privs = {server = true},
func = function(name, param)
local done = core.auth_reload()
return done, (done and S("Done.") or S("Failed."))
end,
})
core.override_chatcommand("remove_player", {
params = S("<name>"),
description = S("Remove a player's data"),
privs = {server = true},
func = function(name, param)
local toname = param
if toname == "" then
return false, S("Name field required")
end
local rc = core.remove_player(toname)
if rc == 0 then
core.log("action", name .. " removed player data of " .. toname .. ".")
return true, S("Player '@1' removed.", toname)
elseif rc == 1 then
return true, S("No such player '@1' to remove.", toname)
elseif rc == 2 then
return true, S("Player '@1' is connected, cannot remove.", toname)
end
return false, S("Unhandled remove_player return code @1", rc)
end,
})
core.override_chatcommand("teleport", {
params = S("<X>,<Y>,<Z> | <to_name> | (<name> <X>,<Y>,<Z>) | (<name> <to_name>)"),
description = S("Teleport to position or player"),
privs = {teleport = true},
func = function(name, param)
-- Returns (pos, true) if found, otherwise (pos, false)
local function find_free_position_near(pos)
local tries = {
{x=1,y=0,z=0},
{x=-1,y=0,z=0},
{x=0,y=0,z=1},
{x=0,y=0,z=-1},
}
for _, d in ipairs(tries) do
local p = {x = pos.x+d.x, y = pos.y+d.y, z = pos.z+d.z}
local n = core.get_node_or_nil(p)
if n and n.name then
local def = core.registered_nodes[n.name]
if def and not def.walkable then
return p, true
end
end
end
return pos, false
end
local teleportee = nil
local p = {}
p.x, p.y, p.z = string.match(param, "^([%d.-]+)[, ] *([%d.-]+)[, ] *([%d.-]+)$")
p.x = tonumber(p.x)
p.y = tonumber(p.y)
p.z = tonumber(p.z)
if p.x and p.y and p.z then
local lm = 31000
if p.x < -lm or p.x > lm or p.y < -lm or p.y > lm or p.z < -lm or p.z > lm then
return false, S("Cannot teleport out of map bounds!")
end
teleportee = core.get_player_by_name(name)
if teleportee then
teleportee:set_pos(p)
return true, S("Teleporting to @1.", core.pos_to_string(p))
end
end
local teleportee = nil
local p = nil
local target_name = nil
target_name = param:match("^([^ ]+)$")
teleportee = core.get_player_by_name(name)
if target_name then
local target = core.get_player_by_name(target_name)
if target then
p = target:get_pos()
end
end
if teleportee and p then
p = find_free_position_near(p)
teleportee:set_pos(p)
return true, S("Teleporting to @1 at @2", target_name, core.pos_to_string(p))
end
if not core.check_player_privs(name, {bring=true}) then
return false, S("You don't have permission to teleport other players (missing bring privilege)")
end
local teleportee = nil
local p = {}
local teleportee_name = nil
teleportee_name, p.x, p.y, p.z = param:match(
"^([^ ]+) +([%d.-]+)[, ] *([%d.-]+)[, ] *([%d.-]+)$")
p.x, p.y, p.z = tonumber(p.x), tonumber(p.y), tonumber(p.z)
if teleportee_name then
teleportee = core.get_player_by_name(teleportee_name)
end
if teleportee and p.x and p.y and p.z then
teleportee:set_pos(p)
return true, S("Teleporting @1 to @2", teleportee_name, core.pos_to_string(p))
end
local teleportee = nil
local p = nil
local teleportee_name = nil
local target_name = nil
teleportee_name, target_name = string.match(param, "^([^ ]+) +([^ ]+)$")
if teleportee_name then
teleportee = core.get_player_by_name(teleportee_name)
end
if target_name then
local target = core.get_player_by_name(target_name)
if target then
p = target:get_pos()
end
end
if teleportee and p then
p = find_free_position_near(p)
teleportee:set_pos(p)
return true, S("Teleporting @1 to @2 at @3", teleportee_name, target_name, core.pos_to_string(p))
end
return false, S("Invalid parameters ('@1') or player not found (see /help teleport)", param)
end,
})
core.override_chatcommand("set", {
params = S("([-n] <name> <value>) | <name>"),
description = S("Set or read server configuration setting"),
privs = {server = true},
func = function(name, param)
local arg, setname, setvalue = string.match(param, "(-[n]) ([^ ]+) (.+)")
if arg and arg == "-n" and setname and setvalue then
core.settings:set(setname, setvalue)
return true, setname .. " = " .. setvalue
end
local setname, setvalue = string.match(param, "([^ ]+) (.+)")
if setname and setvalue then
if not core.settings:get(setname) then
return false, S("Failed. Use '/set -n <name> <value>' to create a new setting.")
end
core.settings:set(setname, setvalue)
return true, S("@1 = @2", setname, setvalue)
end
local setname = string.match(param, "([^ ]+)")
if setname then
local setvalue = core.settings:get(setname)
if not setvalue then
setvalue = S("<not set>")
end
return true, S("@1 = @2", setname, setvalue)
end
return false, S("Invalid parameters (see /help set).")
end,
})
core.override_chatcommand("emergeblocks", {
params = S("(here [<radius>]) | (<pos1> <pos2>)"),
description = S("Load (or, if nonexistent, generate) map blocks contained in area pos1 to pos2 (<pos1> and <pos2> must be in parentheses)"),
privs = {server = true},
func = function(name, param)
local p1, p2 = parse_range_str(name, param)
if p1 == false then
return false, p2
end
local context = {
current_blocks = 0,
total_blocks = 0,
start_time = os.clock(),
requestor_name = name
}
core.emerge_area(p1, p2, emergeblocks_callback, context)
core.after(2, emergeblocks_progress_update, context)
return true, S("Started emerge of area ranging from @1 to @2", core.pos_to_string(p1, 1), core.pos_to_string(p2, 1))
end,
})
core.override_chatcommand("deleteblocks", {
params = S("(here [<radius>]) | (<pos1> <pos2>)"),
description = S("Delete map blocks contained in area pos1 to pos2 (<pos1> and <pos2> must be in parentheses)"),
privs = {server = true},
func = function(name, param)
local p1, p2 = parse_range_str(name, param)
if p1 == false then
return false, p2
end
if core.delete_area(p1, p2) then
return true, S("Successfully cleared area ranging from @1 to @2", core.pos_to_string(p1, 1), ore.pos_to_string(p2, 1))
else
return false, S("Failed to clear one or more blocks in area")
end
end,
})
core.override_chatcommand("fixlight", {
params = S("(here [<radius>]) | (<pos1> <pos2>)"),
description = S("Resets lighting in the area between pos1 and pos2 (<pos1> and <pos2> must be in parentheses)"),
privs = {server = true},
func = function(name, param)
local p1, p2 = parse_range_str(name, param)
if p1 == false then
return false, p2
end
if core.fix_light(p1, p2) then
return true, S("Successfully reset light in the area ranging from @1 to @2", core.pos_to_string(p1, 1), core.pos_to_string(p2, 1))
else
return false, S("Failed to load one or more blocks in area")
end
end,
})
core.override_chatcommand("give", {
params = S("<name> <ItemString> [<count> [<wear>]]"),
description = S("Give item to player"),
privs = {give = true},
func = function(name, param)
local toname, itemstring = string.match(param, "^([^ ]+) +(.+)$")
if not toname or not itemstring then
return false, S("Name and ItemString required")
end
return enhanced_builtin_commands.handle_give_command("/give", name, toname, itemstring)
end,
})
core.override_chatcommand("giveme", {
params = S("<ItemString> [<count> [<wear>]]"),
description = S("Give item to yourself"),
privs = {give = true},
func = function(name, param)
local itemstring = string.match(param, "(.+)$")
if not itemstring then
return false, S("ItemString required")
end
return enhanced_builtin_commands.handle_give_command("/giveme", name, name, itemstring)
end,
})
core.override_chatcommand("spawnentity", {
params = S("<EntityName> [<X>,<Y>,<Z>]"),
description = S("Spawn entity at given (or your) position"),
privs = {give = true, interact = true},
func = function(name, param)
local entityname, p = string.match(param, "^([^ ]+) *(.*)$")
if not entityname then
return false, S("EntityName required")
end
core.log("action", ("%s invokes /spawnentity, entityname=%q")
:format(name, entityname))
local player = core.get_player_by_name(name)
if player == nil then
core.log("error", "Unable to spawn entity, player is nil")
return false, S("Unable to spawn entity, player is nil")
end
if not core.registered_entities[entityname] then
return false, S("Cannot spawn an unknown entity")
end
if p == "" then
p = player:get_pos()
else
p = core.string_to_pos(p)
if p == nil then
return false, S("Invalid parameters ('@1')", param)
end
end
p.y = p.y + 1
core.add_entity(p, entityname)
return true, S("@1 spawned.", entityname)
end,
})
core.override_chatcommand("rollback_check", {
params = S("[<range>] [<seconds>] [<limit>]"),
description = S("Check who last touched a node or a node near it within the time specified by <seconds>. Default: range = 0, seconds = 86400 = 24h, limit = 5"),
privs = {rollback = true},
func = function(name, param)
if not core.settings:get_bool("enable_rollback_recording") then
return false, S("Rollback functions are disabled.")
end
local range, seconds, limit =
param:match("(%d+) *(%d*) *(%d*)")
range = tonumber(range) or 0
seconds = tonumber(seconds) or 86400
limit = tonumber(limit) or 5
if limit > 100 then
return false, S("That limit is too high!")
end
core.rollback_punch_callbacks[name] = function(pos, node, puncher)
local name = puncher:get_player_name()
core.chat_send_player(name, S("Checking @1...", core.pos_to_string(pos)))
local actions = core.rollback_get_node_actions(pos, range, seconds, limit)
if not actions then
core.chat_send_player(name, S("Rollback functions are disabled."))
return
end
local num_actions = #actions
if num_actions == 0 then
core.chat_send_player(name, S("Nobody has touched the specified location in @1 seconds", seconds))
return
end
local time = os.time()
for i = num_actions, 1, -1 do
local action = actions[i]
core.chat_send_player(name,
S(("%s %s %s -> %s %d seconds ago.")
:format(
core.pos_to_string(action.pos),
action.actor,
action.oldnode.name,
action.newnode.name,
time - action.time)))
end
end
return true, S("Punch a node (range=@1, seconds=@2s, limit=@3)", range, seconds, limit)
end,
})
core.override_chatcommand("rollback", {
params = S("(<name> [<seconds>]) | (:<actor> [<seconds>])"),
description = S("Revert actions of a player. Default for <seconds> is 60"),
privs = {rollback = true},
func = function(name, param)
if not core.settings:get_bool("enable_rollback_recording") then
return false, S("Rollback functions are disabled.")
end
local target_name, seconds = string.match(param, ":([^ ]+) *(%d*)")
if not target_name then
local player_name = nil
player_name, seconds = string.match(param, "([^ ]+) *(%d*)")
if not player_name then
return false, S("Invalid parameters. See /help rollback and /help rollback_check.")
end
target_name = "player:"..player_name
end
seconds = tonumber(seconds) or 60
core.chat_send_player(name, S("Reverting actions of @1 since @2 seconds.", target_name, seconds))
local success, log = core.rollback_revert_actions_by(
target_name, seconds)
local response = ""
if #log > 100 then
response = S("(log is too long to show)\n")
else
for _, line in pairs(log) do
response = response .. line .. "\n"
end
end
response = response .. S("Reverting actions @1", (success and "succeeded." or "FAILED."), success)
return success, response
end,
})
core.override_chatcommand("shutdown", {
params = S("[<delay_in_seconds> | -1] [reconnect] [<message>]"),
description = S("Shutdown server (-1 cancels a delayed shutdown)"),
privs = {server = true},
func = function(name, param)
local delay, reconnect, message
delay, param = param:match("^%s*(%S+)(.*)")
if param then
reconnect, param = param:match("^%s*(%S+)(.*)")
end
message = param and param:match("^%s*(.+)") or ""
delay = tonumber(delay) or 0
if delay == 0 then
core.log("action", name .. " shuts down server")
core.chat_send_all("*** Server shutting down (operator request).")
end
core.request_shutdown(message:trim(), core.is_yes(reconnect), delay)
end,
})
core.override_chatcommand("ban", {
params = S("[<name> | <IP_address>]"),
description = S("Ban player or show ban list"),
privs = {ban = true},
func = function(name, param)
if param == "" then
local ban_list = core.get_ban_list()
if ban_list == "" then
return true, S("The ban list is empty.")
else
return true, S("Ban list: @1", ban_list)
end
end
if not core.get_player_by_name(param) then
return false, S("No such player.")
end
if not core.ban_player(param) then
return false, S("Failed to ban player.")
end
local desc = core.get_ban_description(param)
core.log("action", name .. " bans " .. desc .. ".")
return true, S("Banned @1.", desc)
end,
})
core.override_chatcommand("unban", {
params = S("<name> | <IP_address>"),
description = S("Remove player ban"),
privs = {ban = true},
func = function(name, param)
if not core.unban_player_or_ip(param) then
return false, S("Failed to unban player/IP.")
end
core.log("action", name .. " unbans " .. param)
return true, S("Unbanned @1.", param)
end,
})
core.override_chatcommand("kick", {
params = S("<name> [<reason>]"),
description = S("Kick a player"),
privs = {kick = true},
func = function(name, param)
local tokick, reason = param:match("([^ ]+) (.+)")
tokick = tokick or param
if not core.kick_player(tokick, reason) then
return false, S("Failed to kick player @1.", tokick)
end
local log_reason = ""
if reason then
log_reason = " with reason \"" .. reason .. "\""
end
core.log("action", name .. " kicks " .. tokick .. log_reason)
return true, S("Kicked @1.", tokick)
end,
})
core.override_chatcommand("clearobjects", {
params = S("[full | quick]"),
description = S("Clear all objects in world"),
privs = {server = true},
func = function(name, param)
local options = {}
if param == "" or param == "quick" then
options.mode = "quick"
elseif param == "full" then
options.mode = "full"
else
return false, S("Invalid usage, see /help clearobjects.")
end
core.log("action", name .. " clears all objects ("
.. options.mode .. " mode).")
core.chat_send_all(S("Clearing all objects. This may take long. You may experience a timeout (by @1).", name))
core.clear_objects(options)
core.log("action", "Object clearing done.")
core.chat_send_all(S("*** Cleared all objects."))
end,
})
core.override_chatcommand("msg", {
params = S("<name> <message>"),
description = S("Send a private message."),
privs = {shout = true},
func = function(name, param)
local sendto, message = param:match("^(%S+)%s(.+)$")
if not sendto then
return false, S("Invalid usage, see /help msg.")
end
if not core.get_player_by_name(sendto) then
return false, S("The player @1 is not online.", sendto)
end
core.log("action", "PM from " .. name .. " to " .. sendto
.. ": " .. message)
core.chat_send_player(sendto, "PM from " .. name .. ": "
.. message)
return true, S("Message sent.")
end,
})
core.override_chatcommand("last-login", {
params = S("[<name>]"),
description = S("Get the last login time of a player or yourself."),
func = function(name, param)
if param == "" then
param = name
end
local pauth = core.get_auth_handler().get_auth(param)
if pauth and pauth.last_login then
-- Time in UTC, ISO 8601 format
return true, S("Last login time was @1", os.date("!%Y-%m-%dT%H:%M:%SZ", pauth.last_login))
end
return false, S("Last login time is unknown.")
end,
})
core.override_chatcommand("clearinv", {
params = S("[<name>]"),
description = S("Clear the inventory of yourself or another player."),
func = function(name, param)
local player
if param and param ~= "" and param ~= name then
if not core.check_player_privs(name, {server = true}) then
return false, S("You don't have permission to clear another player's inventory (missing privilege: server)")
end
player = core.get_player_by_name(param)
core.chat_send_player(param, S("@1 cleared your inventory.", name))
else
player = core.get_player_by_name(name)
end
if player then
player:get_inventory():set_list("main", {})
player:get_inventory():set_list("craft", {})
player:get_inventory():set_list("craftpreview", {})
core.log("action", name.." clears "..player:get_player_name().."'s inventory")
return true, S("Cleared @1's inventory.", player:get_player_name())
else
return false, S("Player must be online to clear inventory!")
end
end,
})
core.override_chatcommand("kill", {
params = S("[<name>]"),
description = S("Kill player or yourself."),
privs = {server = true},
func = function(name, param)
return enhanced_builtin_commands.handle_kill_command(name, param == "" and name or param)
end,
})

45
intllib.lua Normal file
View File

@ -0,0 +1,45 @@
-- Fallback functions for when `intllib` is not installed.
-- Code released under Unlicense <http://unlicense.org>.
-- Get the latest version of this file at:
-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
local function format(str, ...)
local args = { ... }
local function repl(escape, open, num, close)
if escape == "" then
local replacement = tostring(args[tonumber(num)])
if open == "" then
replacement = replacement..close
end
return replacement
else
return "@"..open..num..close
end
end
return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
end
local gettext, ngettext
if minetest.get_modpath("intllib") then
if intllib.make_gettext_pair then
-- New method using gettext.
gettext, ngettext = intllib.make_gettext_pair()
else
-- Old method using text files.
gettext = intllib.Getter()
end
end
-- Fill in missing functions.
gettext = gettext or function(msgid, ...)
return format(msgid, ...)
end
ngettext = ngettext or function(msgid, msgid_plural, n, ...)
return format(n==1 and msgid or msgid_plural, ...)
end
return gettext, ngettext

649
locale/es.po Normal file
View File

@ -0,0 +1,649 @@
# Spanish translation for Enhanced Builtin Commands.
# Copyright (C) 2019 Panquesito7 and contributors.
# This file is distributed under under the same license as the Enhanced Builtin Commands package.
# Panquesito7, 2019.
msgid ""
msgstr ""
"Project-Id-Version: Enhanced Builtin Commands\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-08-14 8:35+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: functions.lua
msgid "Your privileges are insufficient."
msgstr "Tus privilegios son insuficientes."
#: functions.lua
msgid "Player @1 does not exist."
msgstr "El jugador @1 no existe."
#: functions.lua
msgid "Unknown privilege: @1\n"
msgstr "Privilegio desconocido: @1\n"
#: functions.lua
msgid "@1 granted you privileges: @2"
msgstr "@1 te otorgó privilegios: @2"
#: functions.lua
msgid "Privileges of @1: @2"
msgstr "Privilegios de @1: @2"
#: functions.lua
msgid "Finished emerging %d blocks in %.2fms."
msgstr "Bloques emergentes %d terminados en %.2fms."
#: functions.lua
msgid "emergeblocks update: %d/%d blocks emerged (%.1f%%)"
msgstr "Actualización de bloques emergentes: %d/%d bloques emergidos (%.1f%%)."
#: functions.lua
msgid "Cannot give an empty item"
msgstr "No se puede dar un artículo vacío."
#: functions.lua
msgid "Cannot give an unknown item"
msgstr "No se puede dar un objeto desconocido."
#: functions.lua
msgid "Giving 'ignore' is not allowed"
msgstr "No se puede dar el artículo 'ignore': denegado."
#: functions.lua
msgid "@1 is not a known player"
msgstr "@1 no es un jugador conocido."
#: functions.lua
msgid "could not be "
msgstr "no pudo ser "
#: functions.lua
msgid "partially "
msgstr "parcialmente "
#: functions.lua
msgid "%q %sadded to inventory."
msgstr "%q %sha sido añadido a tu inventario."
#: functions.lua
msgid "%q %sadded to %s's inventory."
msgstr "%q %sha sido añadido al inventario de %s's."
#: init.lua
msgid "Show the name of the server owner"
msgstr "Muestra el nombre del administrador del servidor."
#: init.lua
msgid "<playername>"
msgstr "<jugador>"
#: init.lua
msgid "The administrator of this server is @1."
msgstr "El nombre del administrador de este servidor es @1."
#: init.lua
msgid "There's no administrator named in the config file."
msgstr "No hay administrador nombrado en el archivo de la configuración."
#: init.lua
msgid "Sent to @1."
msgstr "Ha sido mandado a @1."
#: init.lua
msgid "You don't have permission to run this command (missing privilege: server)."
msgstr "No tienes permiso para correr este comando (privilegios faltantes: server)."
#: init.lua
msgid "List mods installed on the server."
msgstr "Muestra los mods instalados en el servidor."
#: init.lua
msgid "Destroy item in hand"
msgstr "Destruir el artículo en la mano."
#: init.lua
msgid "Unable to pulverize, no player."
msgstr "Incapaz de destruir, jugador no disponible."
#: init.lua
msgid "An item was pulverized."
msgstr "El artículo ha sido destruido."
#: init.lua
msgid "Unable to pulverize, no item in @1's hand."
msgstr "Incapaz de destruir, artículo no disponbile en la mano de @1."
#: init.lua
msgid "An item was pulverized by @1."
msgstr "El artículo ha sido destruido por @1."
#: init.lua
msgid "Show server status"
msgstr "Muestra el estado del servidor."
#: init.lua
msgid "This command was disabled by a mod or game"
msgstr "Este comando fue deshabilitado por un mod o por un juego."
#: init.lua
msgid "Show day count since world creation"
msgstr "Muestra el recuento de días desde la creación del mundo."
#: init.lua
msgid "Current day is @1"
msgstr "El día actual es el día @1."
#: init.lua
msgid "<action>"
msgstr "<acción>"
#: init.lua
msgid "Show chat action (e.g., '/me orders a pizza' displays '<player name> orders a pizza')"
msgstr "Mostrar acción de chat (p.ej., '/me pide una pizza' muestra '<ugador> pide una pizza')."
#: init.lua
msgid "[<name>]"
msgstr "[<nombre>]"
#: init.lua
msgid "Show privileges of yourself"
msgstr "Muestra tus privilegios."
#: init.lua
msgid "Player @1 does not exist."
msgstr "El jugador @1 no existe."
#: init.lua
msgid "Privileges of @1: @2"
msgstr "Privilegios de @1: @2"
#: init.lua
msgid "<privilege>"
msgstr "<privilegio>"
#: init.lua
msgid "Return list of all online players with privilege."
msgstr "Lista de retorno de todos los jugadores en línea con el privilegio especificado."
#: init.lua
msgid "Invalid parameters (see /help haspriv)"
msgstr "Parámetros invalidos (vea /help haspriv)."
#: init.lua
msgid "Unknown privilege!"
msgstr "¡Privilegio desconocido!"
#: init.lua
msgid "Players online with the \"@1""\" privilege: @2"
msgstr "Jugadores en línea con el privilegio \"@1""\": @2"
#: init.lua
msgid "<name> (<privilege> | all)"
msgstr "<nombre> (privilegio | todo)"
#: init.lua
msgid "Give privileges to player"
msgstr "Da los privilegios especificados al jugador especificado."
#: init.lua
msgid "Invalid parameters (see /help grant)"
msgstr "Parámetros invalidos (vea /help grant)"
#: init.lua
msgid "<privilege> | all"
msgstr "<privilegio> | todo"
#: init.lua
msgid "Grant privileges to yourself"
msgstr "Otorgar privilegios a ti mismo."
#: init.lua
msgid "Invalid parameters (see /help grantme)"
msgstr "Parámetros invalidos (vea /help grantme)"
#: init.lua
msgid "Remove privileges from player"
msgstr "Revocar los privilegios especificados de un jugador."
#: init.lua
msgid "Invalid parameters (see /help revoke)"
msgstr "Parámetros invalidos (vea /help revoke)"
#: init.lua
msgid "@1 revoked privileges from you: @2"
msgstr "@1 te revocó estos privilegios: @2"
#: init.lua
msgid "Privileges of @1: @2"
msgstr "Privilegios de @1: @2"
#: init.lua
msgid "<name> <password>"
msgstr "<nombre> <contraseña>"
#: init.lua
msgid "Set player's password"
msgstr "Establecer contraseña de un jugador."
#: init.lua
msgid "Name field required"
msgstr "Campo de nombre requerido."
#: init.lua
msgid "Your password was @1 by @2"
msgstr "Tu contraseña fue @1 por @2."
#: init.lua
msgid "<name>"
msgstr "<nombre>"
#: init.lua
msgid "Set empty password for a player"
msgstr "Establecer contraseña vacía para el jugador."
#: init.lua
msgid "Password of player \"@1\" cleared"
msgstr "Contraseña del jugador \"@1\" borrada."
#: init.lua
msgid "Reload authentication data"
msgstr "Recargar datos de autenticación."
#: init.lua
msgid "Done."
msgstr "Listo."
#: init.lua
msgid "Failed."
msgstr "Ha fallado."
#: init.lua
msgid "Remove a player's data"
msgstr "Borrar datos del jugador."
#: init.lua
msgid "Player \"@1""\" removed."
msgstr "El jugador \"@1""\" ha sido borrado."
#: init.lua
msgid "No such player \"@1""\" to remove."
msgstr "El jugador \"@1""\" no se encuentra."
#: init.lua
msgid "Player \"@1""\" is connected, cannot remove."
msgstr "El jugador \"@1""\" esta conectado, incapaz de borrar."
#: init.lua
msgid "Unhandled remove_player return code @1"
msgstr "Código @1 de retorno no manejado."
#: init.lua
msgid "<X>,<Y>,<Z> | <to_name> | (<name> <X>,<Y>,<Z>) | (<name> <to_name>)"
msgstr "<X>,<Y>,<Z> | <para_nombre> | (<nombre> <X,<Y>,<Z>) | (<nombre> <para_nombre>)"
#: init.lua
msgid "Teleport to position or player"
msgstr "Teletransportarse a una posición o a un jugador."
#: init.lua
msgid "Cannot teleport out of map bounds!"
msgstr "¡No se puede teletransportar afuera del mundo!"
#: init.lua
msgid "Teleporting to @1."
msgstr "Teletransportandose a @1."
#: init.lua
msgid "Teleporting to @1 at @2"
msgstr "Teletransportando a @1 en @2."
#: init.lua
msgid "You don't have permission to teleport other players (missing bring privilege)"
msgstr "No tienes permiso para teletransportar otros jugadores (privilegios faltantes: bring)."
#: init.lua
msgid "Teleporting @1 to @2"
msgstr "Teletransportando @1 a @2."
#: init.lua
msgid "Teleporting @1 to @2 at @3"
msgstr "Teletransportando @1 a @2 en @3."
#: init.lua
msgid "Invalid parameters ("'@1'") or player not found (see /help teleport)"
msgstr "Parámetros invalidos ("'@1'") o jugador no encontrado (vea /help teleport)."
#: init.lua
msgid "([-n] <name> <value>) | <name>"
msgstr "([-n] <nombre> <valor>) | <nombre>"
#: init.lua
msgid "Set or read server configuration setting"
msgstr "Establecer o leer la configuración del servidor."
#: init.lua
msgid "Failed. Use '/set -n <name> <value>' to create a new setting."
msgstr "Ha fallado. Use '/set -n <nombre <valor>' para crear una nueva opción."
#: init.lua
msgid "<not set>"
msgstr "<sin establecer>"
#: init.lua
msgid "Invalid parameters (see /help set)."
msgstr "Parámetros invalidos (vea /help set)."
#: init.lua
msgid "(here [<radius>]) | (<pos1> <pos2>)"
msgstr "(aquí [<radius>] | <posición1> <posición2>)"
#: init.lua
msgid "Load (or, if nonexistent, generate) map blocks contained in area pos1 to pos2 (<pos1> and <pos2> must be in parentheses)"
msgstr "Cargue (o, si no existe, genere) los bloques de mapa contenidos en la posición de área 1 a la posición 2 (<pos 1> y <pos2> deben estar entre paréntesis)."
#: init.lua
msgid "Started emerge of area ranging from @1 to @2"
msgstr "Ha comenzado a emergir el área de @1 hasta @2"
#: init.lua
msgid "Delete map blocks contained in area pos1 to pos2 (<pos1> and <pos2> must be in parentheses)"
msgstr "Eliminar los bloques de mapa contenidos en la posición de área 1 a la posición 2 (<posición 1> y <posición 2> deben estar entre paréntesis)"
#: init.lua
msgid "Successfully cleared area ranging from @1 to @2"
msgstr "Área despejada con éxito que va de @1 para @2."
#: init.lua
msgid "Failed to clear one or more blocks in area"
msgstr "No se pudo borrar uno o más bloques en el área."
#: init.lua
msgid "Resets lighting in the area between pos1 and pos2 (<pos1> and <pos2> must be in parentheses)"
msgstr "Reinicia la iluminación en el área entre la posición1 y la posición2 (<posición1> y <posición2> deben estar entre paréntesis)."
#: init.lua
msgid "Successfully reset light in the area ranging from @1 to @2"
msgstr "Se reinició con éxito la luz en el área que va de @1 para @2."
#: init.lua
msgid "Failed to load one or more blocks in area"
msgstr "Error al cargar uno o más bloques en el área."
#: init.lua
msgid "<name> <ItemString> [<count> [<wear>]]"
msgstr "<nombre <Cadena de artículo> [<cantidad> [<desgaste>]]"
#: init.lua
msgid "Give item to player"
msgstr "Dar un artículo a el jugador especificado."
#: init.lua
msgid "Name and ItemString required"
msgstr "Nombre y Cadena de artículo requerido."
#: init.lua
msgid "<ItemString> [<count> [<wear>]]"
msgstr "<Cadena de artículo> [<cantidad> [<desgaste>]]"
#: init.lua
msgid "Give item to yourself"
msgstr "Dar un artículo a ti mismo."
#: init.lua
msgid "ItemString required"
msgstr "Cadena de artículo requerida."
#: init.lua
msgid "<EntityName> [<X>,<Y>,<Z>]"
msgstr "<Nombre de la entidad> [<X>,<Y>,<Z>]"
#: init.lua
msgid "Spawn entity at given (or your) position"
msgstr "Entidad de generación en la posición dada (o la tuya)."
#: init.lua
msgid "EntityName required"
msgstr "Nombre de entidad requerida."
#: init.lua
msgid "Unable to spawn entity, player is nil"
msgstr "Incapaz de generar entidad, jugador no inicializado."
#: init.lua
msgid "Cannot spawn an unknown entity"
msgstr "No se puede generar una entidad desconocida."
#: init.lua
msgid "@1 spawned."
msgstr "@1 generado."
#: init.lua
msgid "[<range>] [<seconds>] [<limit>]"
msgstr "[<rango>] [<segundos>] [<límite>]"
#: init.lua
msgid "Check who last touched a node or a node near it within the time specified by <seconds>. Default: range = 0, seconds = 86400 = 24h, limit = 5"
msgstr "Verifique quién tocó por última vez un nodo o un nodo cercano dentro del tiempo especificado por <segundos>. Por defecto: rango = 0, segundos = 86400 = 24h, límite = 5"
#: init.lua
msgid "Rollback functions are disabled."
msgstr "Las funciones de retroceder están deshabilitadas."
#: init.lua
msgid "That limit is too high!"
msgstr "¡Ese límite es demasiado alto!"
#: init.lua
msgid "Checking @1..."
msgstr "Checando @1..."
#: init.lua
msgid "Nobody has touched the specified location in @1 seconds"
msgstr "Nadie ha tocado la ubicación especificada en @1 segundos."
#: init.lua
msgid "%s %s %s -> %s %d seconds ago."
msgstr "%s %s %s -> %s hace %d segundos."
#: init.lua
msgid "Punch a node (range=@1, seconds=@2s, limit=@3)"
msgstr "Golpear un nodo (rango=@1, segundos=@2, limite=@3)."
#: init.lua
msgid "(<name> [<seconds>]) | (:<actor> [<seconds>])"
msgstr "(<nombre> [<segundos>]) | (:<actor> [<seconds>])"
#: init.lua
msgid "Revert actions of a player. Default for <seconds> is 60"
msgstr "Revertir las acciones de un jugador. El valor predeterminado para <segundos> es 60."
#: init.lua
msgid "Invalid parameters. See /help rollback and /help rollback_check."
msgstr "Parámetros invalidos. Vea /help rollback y /help rollback_check."
#: init.lua
msgid "Reverting actions of @1 since @2 seconds."
msgstr ""
#: init.lua
msgid "(log is too long to show)\n"
msgstr "(el registro es demasiado largo para mostrar)"
#: init.lua
msgid "Reverting actions @1"
msgstr "Revirtiendo acciones @1."
#: init.lua
msgid "succeeded."
msgstr "¡éxito!"
#: init.lua
msgid "FAILED."
msgstr "HA FALLADO."
#: init.lua
msgid "[<delay_in_seconds> | -1] [reconnect] [<message>]"
msgstr "[<retraso_en_segundos | -1] [reconectarse] [<mensaje>]"
#: init.lua
msgid "Shutdown server (-1 cancels a delayed shutdown)"
msgstr "Apagar el servidor (-1 cancela el apagado retrasado)."
#: init.lua
msgid "[<name> | <IP_address>]"
msgstr "[<nombre> | <IP>]"
#: init.lua
msgid "Ban player or show ban list"
msgstr "Prohibir jugador o mostrar lista de prohibición."
#: init.lua
msgid "The ban list is empty."
msgstr "La lista de prohibición está vacía."
#: init.lua
msgid "Ban list: @1"
msgstr "Lista de prohibición: @1"
#: init.lua
msgid "No such player."
msgstr "No hay tal jugador."
#: init.lua
msgid "Failed to ban player."
msgstr "No se pudo prohibir el jugador."
#: init.lua
msgid "Banned @1."
msgstr "El jugador @1 ha sido prohibido."
#: init.lua
msgid "Remove player ban"
msgstr "Eliminar la prohibición del jugador especificado."
#: init.lua
msgid "Failed to unban player/IP."
msgstr "No se pudo eliminar la prohibición del jugador especificado."
#: init.lua
msgid "Unbanned @1."
msgstr "El jugador @1 ha sido eliminado de la listo de prohibición."
#: init.lua
msgid "<name> [<reason>]"
msgstr "<nombre> [<razón>]"
#: init.lua
msgid "Kick a player"
msgstr "Sacar a un jugador."
#: init.lua
msgid "Failed to kick player @1."
msgstr "No se pudo sacar al jugador @1."
#: init.lua
msgid "Kicked @1."
msgstr "El jugador @1 ha sido sacado del servidor."
#: init.lua
msgid "[full | quick]"
msgstr "[completo | rápido]"
#: init.lua
msgid "Clear all objects in world"
msgstr "Quitar todos los objetos en el mundo."
#: init.lua
msgid "Invalid usage, see /help clearobjects."
msgstr "Uso no valido, vea /help clearobjects."
#: init.lua
msgid "Clearing all objects. This may take long. You may experience a timeout (by @1)."
msgstr "Eliminando todos los objetos. Esto puede llevar (mucho) tiempo. Puede experimentar un tiempo de espera."
#: init.lua
msgid "*** Cleared all objects."
msgstr "*** Todos los objetos han sido eliminados."
#: init.lua
msgid "<name> <message>"
msgstr "<nombre> <mensaje>"
#: init.lua
msgid "Send a private message."
msgstr "Mandar un mensaje privado a un jugador."
#: init.lua
msgid "Invalid usage, see /help msg."
msgstr "Uso no valido, vea /help msg."
#: init.lua
msgid "The player @1 is not online."
msgstr "El jugador @1 no esta en línea."
#: init.lua
msgid "Message sent."
msgstr "El mensaje ha sido mandado correctamente."
#: init.lua
msgid "Get the last login time of a player or yourself."
msgstr "Obtenga el último tiempo de inicio de sesión de un jugador o de usted mismo."
#: init.lua
msgid "Last login time was @1"
msgstr "El último tiempo de inicio de sesión fue @1"
#: init.lua
msgid "Last login time is unknown."
msgstr "El último timepo de inicio de sesión no se sabe."
#: init.lua
msgid "Clear the inventory of yourself or another player."
msgstr "Borrar el inventario de ti mismo o de otro jugador."
#: init.lua
msgid "You don't have permission to clear another player's inventory (missing privilege: server)"
msgstr "No tienes permiso para borrar el inventario de otros jugadores (privilegios faltantes: server)"
#: init.lua
msgid "@1 cleared your inventory."
msgstr "@1 borro tu inventario."
#: init.lua
msgid "Cleared @1's inventory."
msgstr "El inventario de @1 ha sido borrado."
#: init.lua
msgid "Player must be online to clear inventory!"
msgstr "¡El jugador debe de estar en línea para poder borrar el inventario"
#: init.lua
msgid "Players can't be killed, damage has been disabled."
msgstr "Los jugadores no se pueden destruir, el daño ha sido deshabilitado."
#: init.lua
msgid "Player @1 is not online."
msgstr "El jugador @1 no esta en línea."
#: init.lua
msgid "You are already dead."
msgstr "Ya estas muerto."
#: init.lua
msgid "@1 is already dead."
msgstr "@1 ya esta muerto."
#: init.lua
msgid "@1 has been killed."
msgstr "@1 ha sido destruido."
#: init.lua
msgid "Kill player or yourself."
msgstr "Destruir un jugador o tu mismo destruirte."

649
locale/template.pot Normal file
View File

@ -0,0 +1,649 @@
# Template translation for Enhanced Builtin Commands.
# Copyright (C) 2019 Panquesito7 and contributors.
# This file is distributed under under the same license as the Enhanced Builtin Commands package.
# Panquesito7, 2019.
msgid ""
msgstr ""
"Project-Id-Version: Enhanced Builtin Commands\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-08-14 8:35+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: functions.lua
msgid "Your privileges are insufficient."
msgstr ""
#: functions.lua
msgid "Player @1 does not exist."
msgstr ""
#: functions.lua
msgid "Unknown privilege: @1\n"
msgstr ""
#: functions.lua
msgid "@1 granted you privileges: @2"
msgstr ""
#: functions.lua
msgid "Privileges of @1: @2"
msgstr ""
#: functions.lua
msgid "Finished emerging %d blocks in %.2fms."
msgstr ""
#: functions.lua
msgid "emergeblocks update: %d/%d blocks emerged (%.1f%%)"
msgstr ""
#: functions.lua
msgid "Cannot give an empty item"
msgstr ""
#: functions.lua
msgid "Cannot give an unknown item"
msgstr ""
#: functions.lua
msgid "Giving 'ignore' is not allowed"
msgstr ""
#: functions.lua
msgid "@1 is not a known player"
msgstr ""
#: functions.lua
msgid "could not be "
msgstr ""
#: functions.lua
msgid "partially "
msgstr ""
#: functions.lua
msgid "%q %sadded to inventory."
msgstr ""
#: functions.lua
msgid "%q %sadded to %s's inventory."
msgstr ""
#: init.lua
msgid "Show the name of the server owner"
msgstr ""
#: init.lua
msgid "<playername>"
msgstr ""
#: init.lua
msgid "The administrator of this server is @1."
msgstr ""
#: init.lua
msgid "There's no administrator named in the config file."
msgstr ""
#: init.lua
msgid "Sent to @1."
msgstr ""
#: init.lua
msgid "You don't have permission to run this command (missing privilege: server)."
msgstr ""
#: init.lua
msgid "List mods installed on the server."
msgstr ""
#: init.lua
msgid "Destroy item in hand"
msgstr ""
#: init.lua
msgid "Unable to pulverize, no player."
msgstr ""
#: init.lua
msgid "An item was pulverized."
msgstr ""
#: init.lua
msgid "Unable to pulverize, no item in @1's hand."
msgstr ""
#: init.lua
msgid "An item was pulverized by @1."
msgstr ""
#: init.lua
msgid "Show server status"
msgstr ""
#: init.lua
msgid "This command was disabled by a mod or game"
msgstr ""
#: init.lua
msgid "Show day count since world creation"
msgstr ""
#: init.lua
msgid "Current day is @1"
msgstr ""
#: init.lua
msgid "<action>"
msgstr ""
#: init.lua
msgid "Show chat action (e.g., '/me orders a pizza' displays '<player name> orders a pizza')"
msgstr ""
#: init.lua
msgid "[<name>]"
msgstr ""
#: init.lua
msgid "Show privileges of yourself"
msgstr ""
#: init.lua
msgid "Player @1 does not exist."
msgstr ""
#: init.lua
msgid "Privileges of @1: @2"
msgstr ""
#: init.lua
msgid "<privilege>"
msgstr ""
#: init.lua
msgid "Return list of all online players with privilege."
msgstr ""
#: init.lua
msgid "Invalid parameters (see /help haspriv)"
msgstr ""
#: init.lua
msgid "Unknown privilege!"
msgstr ""
#: init.lua
msgid "Players online with the '@1' privilege: @2"
msgstr ""
#: init.lua
msgid "<name> (<privilege> | all)"
msgstr ""
#: init.lua
msgid "Give privileges to player"
msgstr ""
#: init.lua
msgid "Invalid parameters (see /help grant)"
msgstr ""
#: init.lua
msgid "<privilege> | all"
msgstr ""
#: init.lua
msgid "Grant privileges to yourself"
msgstr ""
#: init.lua
msgid "Invalid parameters (see /help grantme)"
msgstr ""
#: init.lua
msgid "Remove privileges from player"
msgstr ""
#: init.lua
msgid "Invalid parameters (see /help revoke)"
msgstr ""
#: init.lua
msgid "@1 revoked privileges from you: @2"
msgstr ""
#: init.lua
msgid "Privileges of @1: @2"
msgstr ""
#: init.lua
msgid "<name> <password>"
msgstr ""
#: init.lua
msgid "Set player's password"
msgstr ""
#: init.lua
msgid "Name field required"
msgstr ""
#: init.lua
msgid "Your password was @1 by @2"
msgstr ""
#: init.lua
msgid "<name>"
msgstr ""
#: init.lua
msgid "Set empty password for a player"
msgstr ""
#: init.lua
msgid "Password of player \"@1\" cleared"
msgstr ""
#: init.lua
msgid "Reload authentication data"
msgstr ""
#: init.lua
msgid "Done."
msgstr ""
#: init.lua
msgid "Failed."
msgstr ""
#: init.lua
msgid "Remove a player's data"
msgstr ""
#: init.lua
msgid "Player \"@1""\" removed."
msgstr ""
#: init.lua
msgid "No such player \"@1""\" to remove."
msgstr ""
#: init.lua
msgid "Player \"@1""\" is connected, cannot remove."
msgstr ""
#: init.lua
msgid "Unhandled remove_player return code @1"
msgstr ""
#: init.lua
msgid "<X>,<Y>,<Z> | <to_name> | (<name> <X>,<Y>,<Z>) | (<name> <to_name>)"
msgstr ""
#: init.lua
msgid "Teleport to position or player"
msgstr ""
#: init.lua
msgid "Cannot teleport out of map bounds!"
msgstr ""
#: init.lua
msgid "Teleporting to @1."
msgstr ""
#: init.lua
msgid "Teleporting to @1 at @2"
msgstr ""
#: init.lua
msgid "You don't have permission to teleport other players (missing bring privilege)"
msgstr ""
#: init.lua
msgid "Teleporting @1 to @2"
msgstr ""
#: init.lua
msgid "Teleporting @1 to @2 at @3"
msgstr ""
#: init.lua
msgid "Invalid parameters ("'@1'") or player not found (see /help teleport)"
msgstr ""
#: init.lua
msgid "([-n] <name> <value>) | <name>"
msgstr ""
#: init.lua
msgid "Set or read server configuration setting"
msgstr ""
#: init.lua
msgid "Failed. Use '/set -n <name> <value>' to create a new setting."
msgstr ""
#: init.lua
msgid "<not set>"
msgstr ""
#: init.lua
msgid "Invalid parameters (see /help set)."
msgstr ""
#: init.lua
msgid "(here [<radius>]) | (<pos1> <pos2>)"
msgstr ""
#: init.lua
msgid "Load (or, if nonexistent, generate) map blocks contained in area pos1 to pos2 (<pos1> and <pos2> must be in parentheses)"
msgstr ""
#: init.lua
msgid "Started emerge of area ranging from @1 to @2"
msgstr ""
#: init.lua
msgid "Delete map blocks contained in area pos1 to pos2 (<pos1> and <pos2> must be in parentheses)"
msgstr ""
#: init.lua
msgid "Successfully cleared area ranging from @1 to @2"
msgstr ""
#: init.lua
msgid "Failed to clear one or more blocks in area"
msgstr ""
#: init.lua
msgid "Resets lighting in the area between pos1 and pos2 (<pos1> and <pos2> must be in parentheses)"
msgstr ""
#: init.lua
msgid "Successfully reset light in the area ranging from @1 to @2"
msgstr ""
#: init.lua
msgid "Failed to load one or more blocks in area"
msgstr ""
#: init.lua
msgid "<name> <ItemString> [<count> [<wear>]]"
msgstr ""
#: init.lua
msgid "Give item to player"
msgstr ""
#: init.lua
msgid "Name and ItemString required"
msgstr ""
#: init.lua
msgid "<ItemString> [<count> [<wear>]]"
msgstr ""
#: init.lua
msgid "Give item to yourself"
msgstr ""
#: init.lua
msgid "ItemString required"
msgstr ""
#: init.lua
msgid "<EntityName> [<X>,<Y>,<Z>]"
msgstr ""
#: init.lua
msgid "Spawn entity at given (or your) position"
msgstr ""
#: init.lua
msgid "EntityName required"
msgstr ""
#: init.lua
msgid "Unable to spawn entity, player is nil"
msgstr ""
#: init.lua
msgid "Cannot spawn an unknown entity"
msgstr ""
#: init.lua
msgid "@1 spawned."
msgstr ""
#: init.lua
msgid "[<range>] [<seconds>] [<limit>]"
msgstr ""
#: init.lua
msgid "Check who last touched a node or a node near it within the time specified by <seconds>. Default: range = 0, seconds = 86400 = 24h, limit = 5"
msgstr ""
#: init.lua
msgid "Rollback functions are disabled."
msgstr ""
#: init.lua
msgid "That limit is too high!"
msgstr ""
#: init.lua
msgid "Checking @1..."
msgstr ""
#: init.lua
msgid "Nobody has touched the specified location in @1 seconds"
msgstr ""
#: init.lua
msgid "%s %s %s -> %s %d seconds ago."
msgstr ""
#: init.lua
msgid "Punch a node (range=@1, seconds=@2s, limit=@3)"
msgstr ""
#: init.lua
msgid "(<name> [<seconds>]) | (:<actor> [<seconds>])"
msgstr ""
#: init.lua
msgid "Revert actions of a player. Default for <seconds> is 60"
msgstr ""
#: init.lua
msgid "Invalid parameters. See /help rollback and /help rollback_check."
msgstr ""
#: init.lua
msgid "Reverting actions of @1 since @2 seconds."
msgstr ""
#: init.lua
msgid "(log is too long to show)\n"
msgstr ""
#: init.lua
msgid "Reverting actions @1"
msgstr ""
#: init.lua
msgid "succeeded."
msgstr ""
#: init.lua
msgid "FAILED."
msgstr ""
#: init.lua
msgid "[<delay_in_seconds> | -1] [reconnect] [<message>]"
msgstr ""
#: init.lua
msgid "Shutdown server (-1 cancels a delayed shutdown)"
msgstr ""
#: init.lua
msgid "[<name> | <IP_address>]"
msgstr ""
#: init.lua
msgid "Ban player or show ban list"
msgstr ""
#: init.lua
msgid "The ban list is empty."
msgstr ""
#: init.lua
msgid "Ban list: @1"
msgstr ""
#: init.lua
msgid "No such player."
msgstr ""
#: init.lua
msgid "Failed to ban player."
msgstr ""
#: init.lua
msgid "Banned @1."
msgstr ""
#: init.lua
msgid "Remove player ban"
msgstr ""
#: init.lua
msgid "Failed to unban player/IP."
msgstr ""
#: init.lua
msgid "Unbanned @1."
msgstr ""
#: init.lua
msgid "<name> [<reason>]"
msgstr ""
#: init.lua
msgid "Kick a player"
msgstr ""
#: init.lua
msgid "Failed to kick player @1."
msgstr ""
#: init.lua
msgid "Kicked @1."
msgstr ""
#: init.lua
msgid "[full | quick]"
msgstr ""
#: init.lua
msgid "Clear all objects in world"
msgstr ""
#: init.lua
msgid "Invalid usage, see /help clearobjects."
msgstr ""
#: init.lua
msgid "Clearing all objects. This may take long. You may experience a timeout (by @1)."
msgstr ""
#: init.lua
msgid "*** Cleared all objects."
msgstr ""
#: init.lua
msgid "<name> <message>"
msgstr ""
#: init.lua
msgid "Send a private message."
msgstr ""
#: init.lua
msgid "Invalid usage, see /help msg."
msgstr ""
#: init.lua
msgid "The player @1 is not online."
msgstr ""
#: init.lua
msgid "Message sent."
msgstr ""
#: init.lua
msgid "Get the last login time of a player or yourself."
msgstr ""
#: init.lua
msgid "Last login time was @1"
msgstr ""
#: init.lua
msgid "Last login time is unknown."
msgstr ""
#: init.lua
msgid "Clear the inventory of yourself or another player."
msgstr ""
#: init.lua
msgid "You don't have permission to clear another player's inventory (missing privilege: server)"
msgstr ""
#: init.lua
msgid "@1 cleared your inventory."
msgstr ""
#: init.lua
msgid "Cleared @1's inventory."
msgstr ""
#: init.lua
msgid "Player must be online to clear inventory!"
msgstr ""
#: init.lua
msgid "Players can't be killed, damage has been disabled."
msgstr ""
#: init.lua
msgid "Player @1 is not online."
msgstr ""
#: init.lua
msgid "You are already dead."
msgstr ""
#: init.lua
msgid "@1 is already dead."
msgstr ""
#: init.lua
msgid "@1 has been killed."
msgstr ""
#: init.lua
msgid "Kill player or yourself."
msgstr ""

3
mod.conf Normal file
View File

@ -0,0 +1,3 @@
name = enhanced_builtin_commands
optional_depends = intllib
description = Adds support for intllib for the builtin commands.