erase translation support, this is a minimal admin mod
This commit is contained in:
parent
8227b61903
commit
53eb2e5178
36
init.lua
36
init.lua
@ -5,30 +5,6 @@
|
|||||||
|
|
||||||
-- This file is part of antimod minenux Minetest Mod.
|
-- This file is part of antimod minenux Minetest Mod.
|
||||||
|
|
||||||
-- Load support for MT game translation.
|
|
||||||
-- Check for translation method
|
|
||||||
local S
|
|
||||||
if minetest.get_translator ~= nil then
|
|
||||||
S = minetest.get_translator(core.get_current_modname()) -- 5.x translation function
|
|
||||||
else
|
|
||||||
if minetest.get_modpath("intllib") then
|
|
||||||
dofile(minetest.get_modpath("intllib") .. "/init.lua")
|
|
||||||
if intllib.make_gettext_pair then
|
|
||||||
gettext, ngettext = intllib.make_gettext_pair() -- new gettext method
|
|
||||||
else
|
|
||||||
gettext = intllib.Getter() -- old text file method
|
|
||||||
end
|
|
||||||
S = gettext
|
|
||||||
else -- boilerplate function
|
|
||||||
S = function(str, ...)
|
|
||||||
local args = {...}
|
|
||||||
return str:gsub("@%d+", function(match)
|
|
||||||
return args[tonumber(match:sub(2))]
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local kill_hitter = core.settings:get_bool("antipvp_kill_hitter") or false
|
local kill_hitter = core.settings:get_bool("antipvp_kill_hitter") or false
|
||||||
|
|
||||||
local admin_privs = core.settings:get_bool("antipvp_admin_privs") or true
|
local admin_privs = core.settings:get_bool("antipvp_admin_privs") or true
|
||||||
@ -37,13 +13,13 @@ local send_notify = core.settings:get_bool("antipvp_send_notify") or true
|
|||||||
|
|
||||||
local send_to_all = core.settings:get_bool("antipvp_send_to_all") or false
|
local send_to_all = core.settings:get_bool("antipvp_send_to_all") or false
|
||||||
|
|
||||||
local area_ratio = tonumber(minetest.setting_get("antipvp_area_ratio") or 3)
|
local area_ratio = tonumber(minetest.setting_get("antipvp_area_ratio") or 2)
|
||||||
|
|
||||||
if kill_hitter == nil then kill_hitter = false end
|
if kill_hitter == nil then kill_hitter = false end
|
||||||
if admin_privs == nil then admin_privs = true end
|
if admin_privs == nil then admin_privs = true end
|
||||||
if send_notify == nil then send_notify = true end
|
if send_notify == nil then send_notify = true end
|
||||||
if send_to_all == nil then send_to_all = false end
|
if send_to_all == nil then send_to_all = false end
|
||||||
if area_ratio == nil then area_ratio = 3 end
|
if area_ratio == nil then area_ratio = 2 end
|
||||||
|
|
||||||
-- compat with irc mod fork
|
-- compat with irc mod fork
|
||||||
if core.get_modpath("irc") then
|
if core.get_modpath("irc") then
|
||||||
@ -58,7 +34,7 @@ if admin_privs then privs_give_to_admin = true end
|
|||||||
|
|
||||||
-- priv
|
-- priv
|
||||||
core.register_privilege("antipvp", {
|
core.register_privilege("antipvp", {
|
||||||
description = S("Invulnerable in PVP"),
|
description = "Invulnerable in PVP",
|
||||||
give_to_singleplayer = false,
|
give_to_singleplayer = false,
|
||||||
give_to_admin = privs_give_to_admin,
|
give_to_admin = privs_give_to_admin,
|
||||||
})
|
})
|
||||||
@ -72,7 +48,7 @@ core.register_node("antipvp:quiet", {
|
|||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
walkable = false,
|
walkable = false,
|
||||||
groups = {choppy=3, level=3}
|
groups = {choppy=2, level=3}
|
||||||
})
|
})
|
||||||
|
|
||||||
-- craft
|
-- craft
|
||||||
@ -107,8 +83,8 @@ core.register_on_punchplayer(
|
|||||||
end
|
end
|
||||||
|
|
||||||
if send_notify then
|
if send_notify then
|
||||||
core.chat_send_player(hitter_name, S("You can not hurt a God") )
|
core.chat_send_player(hitter_name, "You can not hurt a God" )
|
||||||
core.chat_send_player(player_name, S("@1 try hurt you", hitter_name) )
|
core.chat_send_player(player_name, hitter_name.." try hurt you" )
|
||||||
if core.get_modpath("irc") then
|
if core.get_modpath("irc") then
|
||||||
if send_to_all then
|
if send_to_all then
|
||||||
irc.saysec(hitter_name.." try hurt to "..player_name)
|
irc.saysec(hitter_name.." try hurt to "..player_name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user