sethome - update mod to upstream
This commit is contained in:
parent
284eb28d6c
commit
8e59006dc8
@ -27,6 +27,7 @@ Most of those mods have mirror at http://git.mirror.org
|
|||||||
| sfinv | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | |
|
| sfinv | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | |
|
||||||
| stairs | https://codeberg.org/minenux/minetest-mod-stairs | https://codeberg.org/minenux/minetest-mod-stairs/commit/c3a5af6c452daca599d226df694df1b75f15c110 | [stairs/README.md](stairs/README.md) |
|
| stairs | https://codeberg.org/minenux/minetest-mod-stairs | https://codeberg.org/minenux/minetest-mod-stairs/commit/c3a5af6c452daca599d226df694df1b75f15c110 | [stairs/README.md](stairs/README.md) |
|
||||||
| screwdriver | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | |
|
| screwdriver | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | |
|
||||||
|
| sethome | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | |
|
||||||
| tnt | https://codeberg.org/minenux/minetest-mod-tnt | https://codeberg.org/minenux/minetest-mod-tnt/commit/8195861f905a90b53cd52348deb34df41a053027 | [tnt/README.md](tnt/README.md) |
|
| tnt | https://codeberg.org/minenux/minetest-mod-tnt | https://codeberg.org/minenux/minetest-mod-tnt/commit/8195861f905a90b53cd52348deb34df41a053027 | [tnt/README.md](tnt/README.md) |
|
||||||
| toolranks | https://codeberg.org/minenux/minetest-mod-toolranks | https://codeberg.org/minenux/minetest-mod-toolranks/commit/5c9553e5ac6cc7ae375033b76ef7771a6935c771 | [toolranks/README.md](toolranks/README.md) |
|
| toolranks | https://codeberg.org/minenux/minetest-mod-toolranks | https://codeberg.org/minenux/minetest-mod-toolranks/commit/5c9553e5ac6cc7ae375033b76ef7771a6935c771 | [toolranks/README.md](toolranks/README.md) |
|
||||||
| vessels | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | |
|
| vessels | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | |
|
||||||
|
@ -1,8 +1,36 @@
|
|||||||
|
-- sethome/init.lua
|
||||||
|
|
||||||
sethome = {}
|
sethome = {}
|
||||||
|
|
||||||
|
-- Load support for MT game translation.
|
||||||
|
local S
|
||||||
|
|
||||||
|
|
||||||
local homes_file = minetest.get_worldpath() .. "/homes"
|
local homes_file = minetest.get_worldpath() .. "/homes"
|
||||||
local homepos = {}
|
local homepos = {}
|
||||||
|
local is_50 = minetest.has_feature("object_use_texture_alpha") or false
|
||||||
|
|
||||||
|
if minetest.get_translator ~= nil then
|
||||||
|
S = minetest.get_translator("sethome") -- 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 function loadhomes()
|
local function loadhomes()
|
||||||
local input = io.open(homes_file, "r")
|
local input = io.open(homes_file, "r")
|
||||||
@ -24,9 +52,17 @@ sethome.set = function(name, pos)
|
|||||||
if not player or not pos then
|
if not player or not pos then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
if is_50 then
|
||||||
|
local player_meta = player:get_meta()
|
||||||
|
player_meta:set_string("sethome:home", minetest.pos_to_string(pos))
|
||||||
|
else
|
||||||
player:set_attribute("sethome:home", minetest.pos_to_string(pos))
|
player:set_attribute("sethome:home", minetest.pos_to_string(pos))
|
||||||
|
end
|
||||||
|
|
||||||
-- remove `name` from the old storage file
|
-- remove `name` from the old storage file
|
||||||
|
if not homepos[name] then
|
||||||
|
return true
|
||||||
|
end
|
||||||
local data = {}
|
local data = {}
|
||||||
local output = io.open(homes_file, "w")
|
local output = io.open(homes_file, "w")
|
||||||
if output then
|
if output then
|
||||||
@ -43,7 +79,17 @@ end
|
|||||||
|
|
||||||
sethome.get = function(name)
|
sethome.get = function(name)
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
local pos = minetest.string_to_pos(player:get_attribute("sethome:home"))
|
if not player then
|
||||||
|
return false, S("This command can only be executed in-game!")
|
||||||
|
end
|
||||||
|
local player_meta
|
||||||
|
local pos
|
||||||
|
if is_50 then
|
||||||
|
player_meta = player:get_meta()
|
||||||
|
pos = minetest.string_to_pos(player_meta:get_string("sethome:home"))
|
||||||
|
else
|
||||||
|
pos = minetest.string_to_pos(player:get_attribute("sethome:home"))
|
||||||
|
end
|
||||||
if pos then
|
if pos then
|
||||||
return pos
|
return pos
|
||||||
end
|
end
|
||||||
@ -61,37 +107,41 @@ sethome.go = function(name)
|
|||||||
local pos = sethome.get(name)
|
local pos = sethome.get(name)
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
if player and pos then
|
if player and pos then
|
||||||
player:setpos(pos)
|
player:set_pos(pos)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_privilege("home", {
|
minetest.register_privilege("home", {
|
||||||
description = "Can use /sethome and /home",
|
description = S("Can use /sethome and /home"),
|
||||||
give_to_singleplayer = false
|
give_to_singleplayer = false
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("home", {
|
minetest.register_chatcommand("home", {
|
||||||
description = "Teleport you to your home point",
|
description = S("Teleport you to your home point"),
|
||||||
privs = {home = true},
|
privs = {home = true},
|
||||||
func = function(name)
|
func = function(name)
|
||||||
if sethome.go(name) then
|
local player = minetest.get_player_by_name(name)
|
||||||
return true, "Teleported to home!"
|
if not player then
|
||||||
|
return false, S("This command can only be executed in-game!")
|
||||||
end
|
end
|
||||||
return false, "Set a home using /sethome"
|
if sethome.go(name) then
|
||||||
|
return true, S("Teleported to home!")
|
||||||
|
end
|
||||||
|
return false, S("Set a home using /sethome")
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("sethome", {
|
minetest.register_chatcommand("sethome", {
|
||||||
description = "Set your home point",
|
description = S("Set your home point"),
|
||||||
privs = {home = true},
|
privs = {home = true},
|
||||||
func = function(name)
|
func = function(name)
|
||||||
name = name or "" -- fallback to blank name if nil
|
name = name or "" -- fallback to blank name if nil
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
if player and sethome.set(name, player:getpos()) then
|
if player and sethome.set(name, player:get_pos()) then
|
||||||
return true, "Home set!"
|
return true, S("Home set!")
|
||||||
end
|
end
|
||||||
return false, "Player not found!"
|
return false, S("Player not found!")
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
9
mods/sethome/locale/sethome.de.tr
Normal file
9
mods/sethome/locale/sethome.de.tr
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# textdomain: sethome
|
||||||
|
This command can only be executed in-game!=Dieser Befehl kann nur im Spiel ausgeführt werden!
|
||||||
|
Can use /sethome and /home=Kann /sethome und /home benutzen
|
||||||
|
Teleport you to your home point=Teleportieren Sie sich zu Ihrem Zuhause-Punkt
|
||||||
|
Teleported to home!=Nach Hause teleportiert!
|
||||||
|
Set a home using /sethome=Ein Zuhause mit /sethome setzen
|
||||||
|
Set your home point=Ihren Zuhause-Punkt setzen
|
||||||
|
Home set!=Zuhause gesetzt!
|
||||||
|
Player not found!=Spieler nicht gefunden!
|
9
mods/sethome/locale/sethome.eo.tr
Normal file
9
mods/sethome/locale/sethome.eo.tr
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# textdomain: sethome
|
||||||
|
This command can only be executed in-game!=
|
||||||
|
Can use /sethome and /home=Povas uzi /sethome kaj /home
|
||||||
|
Teleport you to your home point=Teletransporti vin al via hejmo
|
||||||
|
Teleported to home!=Teletransportita al hejmo!
|
||||||
|
Set a home using /sethome=Fiksi hejmon per /sethome
|
||||||
|
Set your home point=Fiksi vian hejman punkton
|
||||||
|
Home set!=Fiksita hejmo!
|
||||||
|
Player not found!=Ludanto ne troveblas!
|
9
mods/sethome/locale/sethome.es.tr
Normal file
9
mods/sethome/locale/sethome.es.tr
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# textdomain: sethome
|
||||||
|
This command can only be executed in-game!=
|
||||||
|
Can use /sethome and /home=Puedes usar /sethome y /home
|
||||||
|
Teleport you to your home point=Teletranspórtate a tu hogar
|
||||||
|
Teleported to home!=¡Teletransportado a tu hogar!
|
||||||
|
Set a home using /sethome=Establece tu hogar usando /sethome
|
||||||
|
Set your home point=Establece el sitio de tu hogar
|
||||||
|
Home set!=¡Hogar establecido!
|
||||||
|
Player not found!=¡Jugador no encontrado!
|
9
mods/sethome/locale/sethome.fr.tr
Normal file
9
mods/sethome/locale/sethome.fr.tr
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# textdomain: sethome
|
||||||
|
This command can only be executed in-game!=Cette commande peut seulement être exécutée en jeu !
|
||||||
|
Can use /sethome and /home=Peut utiliser /sethome et /home
|
||||||
|
Teleport you to your home point=Vous téléporter à votre domicile
|
||||||
|
Teleported to home!=Téléporté à votre domicile !
|
||||||
|
Set a home using /sethome=Définir un domicile en utilisant /sethome
|
||||||
|
Set your home point=Définir votre domicile
|
||||||
|
Home set!=Domicile défini !
|
||||||
|
Player not found!=Joueur non trouvé !
|
9
mods/sethome/locale/sethome.id.tr
Normal file
9
mods/sethome/locale/sethome.id.tr
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# textdomain: sethome
|
||||||
|
This command can only be executed in-game!=
|
||||||
|
Can use /sethome and /home=Boleh pakai /sethome dan /home
|
||||||
|
Teleport you to your home point=Teleportasi ke rumah Anda
|
||||||
|
Teleported to home!=Teleportasi ke rumah!
|
||||||
|
Set a home using /sethome=Atur letak rumah dengan /sethome
|
||||||
|
Set your home point=Atur letak rumah
|
||||||
|
Home set!=Letak rumah diatur!
|
||||||
|
Player not found!=Pemain tidak ditemukan!
|
9
mods/sethome/locale/sethome.it.tr
Normal file
9
mods/sethome/locale/sethome.it.tr
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# textdomain: sethome
|
||||||
|
This command can only be executed in-game!=
|
||||||
|
Can use /sethome and /home=Può usare /sethome e /home
|
||||||
|
Teleport you to your home point=Ti teletrasporta al tuo punto di domicilio
|
||||||
|
Teleported to home!=Teletrasportato a casa!
|
||||||
|
Set a home using /sethome=Imposta un domicilio usando /sethome
|
||||||
|
Set your home point=Imposta il tuo punto di domicilio
|
||||||
|
Home set!=Domicilio impostato!
|
||||||
|
Player not found!=Giocatore non trovato!
|
9
mods/sethome/locale/sethome.ja.tr
Normal file
9
mods/sethome/locale/sethome.ja.tr
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# textdomain: sethome
|
||||||
|
This command can only be executed in-game!=
|
||||||
|
Can use /sethome and /home=/sethomeと/homeが使えます
|
||||||
|
Teleport you to your home point=ホーム地点にテレポートします
|
||||||
|
Teleported to home!=ホームにテレポート!
|
||||||
|
Set a home using /sethome=/sethomeを使ってホームを設定します
|
||||||
|
Set your home point=ホーム地点を設定します
|
||||||
|
Home set!=ホーム地点をセット!
|
||||||
|
Player not found!=プレーヤーが見つかりません!
|
9
mods/sethome/locale/sethome.jbo.tr
Normal file
9
mods/sethome/locale/sethome.jbo.tr
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# textdomain: sethome
|
||||||
|
This command can only be executed in-game!=
|
||||||
|
Can use /sethome and /home=kakne lo nu pilno lo me zoi gy./sethome.gy. ku .e lo me zoi gy./home.gy.
|
||||||
|
Teleport you to your home point=sukmu'u lo do zdani mokca
|
||||||
|
Teleported to home!=puba'o sukmu'u lo zdani
|
||||||
|
Set a home using /sethome=ko tcimi'e fi lo zdani sepi'o lo me zoi gy./sethome.gy.
|
||||||
|
Set your home point=tcimi'e fi lo do zdani mokca
|
||||||
|
Home set!=puba'o tcimi'e fi lo zdani
|
||||||
|
Player not found!=lo kelci na te facki
|
9
mods/sethome/locale/sethome.ms.tr
Normal file
9
mods/sethome/locale/sethome.ms.tr
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# textdomain: sethome
|
||||||
|
This command can only be executed in-game!=
|
||||||
|
Can use /sethome and /home=Boleh guna /sethome dan /home
|
||||||
|
Teleport you to your home point=Teleportasikan anda ke titik rumah anda
|
||||||
|
Teleported to home!=Diteleportasikan ke rumah!
|
||||||
|
Set a home using /sethome=Tetapkan rumah menggunakan /sethome
|
||||||
|
Set your home point=Tetapkan titik rumah anda
|
||||||
|
Home set!=Rumah ditetapkan!
|
||||||
|
Player not found!=Pemain tidak dijumpai!
|
9
mods/sethome/locale/sethome.pl.tr
Normal file
9
mods/sethome/locale/sethome.pl.tr
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# textdomain: sethome
|
||||||
|
This command can only be executed in-game!=
|
||||||
|
Can use /sethome and /home=Może używać /sethome i /home
|
||||||
|
Teleport you to your home point=Teleportuj się do swojego punktu domowego
|
||||||
|
Teleported to home!=Teleportowano do punktu domowego
|
||||||
|
Set a home using /sethome=Ustaw punkt domowy używając /sethome
|
||||||
|
Set your home point=Ustaw swój punkt domowy
|
||||||
|
Home set!=Punkt domowy ustawiony!
|
||||||
|
Player not found!=Gracz nie odnaleziony!
|
9
mods/sethome/locale/sethome.pt_BR.tr
Normal file
9
mods/sethome/locale/sethome.pt_BR.tr
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# textdomain: sethome
|
||||||
|
This command can only be executed in-game!=
|
||||||
|
Can use /sethome and /home=Pode usar /sethome e /home
|
||||||
|
Teleport you to your home point=Teletransportá-lo para seu ponto de origem
|
||||||
|
Teleported to home!=Teletransportado para o ponto de origem!
|
||||||
|
Set a home using /sethome=Defina um ponto de origem usando /sethome
|
||||||
|
Set your home point=Define seu ponto de origem
|
||||||
|
Home set!=Ponto de origem definido!
|
||||||
|
Player not found!=Jogador não encontrado!
|
9
mods/sethome/locale/sethome.ru.tr
Normal file
9
mods/sethome/locale/sethome.ru.tr
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# textdomain: sethome
|
||||||
|
This command can only be executed in-game!=Эта команда может быть использована только в игре!
|
||||||
|
Can use /sethome and /home=Возможность использовать /sethome и /home
|
||||||
|
Teleport you to your home point=Вы телепортируетесь в свою домашнюю точку
|
||||||
|
Teleported to home!=Вы телепортировались домой!
|
||||||
|
Set a home using /sethome=Установите домашнюю точку, используя /sethome
|
||||||
|
Set your home point=Установите вашу домашнюю точку
|
||||||
|
Home set!=Домашняя точка установлена!
|
||||||
|
Player not found!=Игрок не обнаружен!
|
8
mods/sethome/locale/sethome.se.tr
Normal file
8
mods/sethome/locale/sethome.se.tr
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# textdomain: sethome
|
||||||
|
Can use /sethome and /home=Kan används /sethome och /home
|
||||||
|
Teleport you to your home point=Teleportera dig till din hempunkt
|
||||||
|
Teleported to home!=Teleporterad hem!
|
||||||
|
Set a home using /sethome=Ställ in ett hem med /sethome
|
||||||
|
Set your home point=Ställ in din hempunkt
|
||||||
|
Home set!=Hem inställt!
|
||||||
|
Player not found!=Spelare inte hittad!
|
9
mods/sethome/locale/sethome.sk.tr
Normal file
9
mods/sethome/locale/sethome.sk.tr
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# textdomain: sethome
|
||||||
|
This command can only be executed in-game!=
|
||||||
|
Can use /sethome and /home=Môžeš použivať /sethome a /home
|
||||||
|
Teleport you to your home point=Teleportuj sa domov
|
||||||
|
Teleported to home!=Teleportovaný domov!
|
||||||
|
Set a home using /sethome=Nastav si domov použitím /sethome
|
||||||
|
Set your home point=Nastaviť si domov
|
||||||
|
Home set!=Domov nastavený!
|
||||||
|
Player not found!=Hráč nenájdený!
|
9
mods/sethome/locale/sethome.sv.tr
Normal file
9
mods/sethome/locale/sethome.sv.tr
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# textdomain: sethome
|
||||||
|
This command can only be executed in-game!=
|
||||||
|
Can use /sethome and /home=Kan använda /sethome och /home
|
||||||
|
Teleport you to your home point=Teleportera dig till din hempunkt
|
||||||
|
Teleported to home!=Teleporterad hem!
|
||||||
|
Set a home using /sethome=Ställ in ett hem med /sethome
|
||||||
|
Set your home point=Ställ in din hempunkt
|
||||||
|
Home set!=Hem inställt!
|
||||||
|
Player not found!=Spelare finns inte!
|
9
mods/sethome/locale/sethome.uk.tr
Normal file
9
mods/sethome/locale/sethome.uk.tr
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# textdomain: sethome
|
||||||
|
This command can only be executed in-game!=
|
||||||
|
Can use /sethome and /home=Можливість використання /sethome та /home
|
||||||
|
Teleport you to your home point=Ви телепортуєтесь у свою домашню точку
|
||||||
|
Teleported to home!=Ви телепортувались додому!
|
||||||
|
Set a home using /sethome=Встановіть домашню точку, використовуючи /sethome
|
||||||
|
Set your home point=Встановіть домашню точку
|
||||||
|
Home set!=Домашня точка встановлена!
|
||||||
|
Player not found!=Гравець не визначений!
|
9
mods/sethome/locale/sethome.zh_CN.tr
Normal file
9
mods/sethome/locale/sethome.zh_CN.tr
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# textdomain: sethome
|
||||||
|
This command can only be executed in-game!=该指令只能在游戏内使用!
|
||||||
|
Can use /sethome and /home=可以使用/sethome和/home
|
||||||
|
Teleport you to your home point=将您传送到家
|
||||||
|
Teleported to home!=已传送到家!
|
||||||
|
Set a home using /sethome=使用/sethome设定家
|
||||||
|
Set your home point=设定您家的地点
|
||||||
|
Home set!=已设定家!
|
||||||
|
Player not found!=未找到玩家!
|
9
mods/sethome/locale/sethome.zh_TW.tr
Normal file
9
mods/sethome/locale/sethome.zh_TW.tr
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# textdomain: sethome
|
||||||
|
This command can only be executed in-game!=此指令僅能在游戲内使用!
|
||||||
|
Can use /sethome and /home=可以使用/sethome和/home
|
||||||
|
Teleport you to your home point=傳送您到您家的地點
|
||||||
|
Teleported to home!=已傳送到家!
|
||||||
|
Set a home using /sethome=使用/sethome設定家
|
||||||
|
Set your home point=設定您家的地點
|
||||||
|
Home set!=已設定家!
|
||||||
|
Player not found!=未找到玩家!
|
9
mods/sethome/locale/template.txt
Normal file
9
mods/sethome/locale/template.txt
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# textdomain: sethome
|
||||||
|
This command can only be executed in-game!=
|
||||||
|
Can use /sethome and /home=
|
||||||
|
Teleport you to your home point=
|
||||||
|
Teleported to home!=
|
||||||
|
Set a home using /sethome=
|
||||||
|
Set your home point=
|
||||||
|
Home set!=
|
||||||
|
Player not found!=
|
2
mods/sethome/mod.conf
Normal file
2
mods/sethome/mod.conf
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
name = sethome
|
||||||
|
description = HOME manager support in game
|
Loading…
x
Reference in New Issue
Block a user