write something there
This commit is contained in:
commit
b4b6c08f4f
8546 changed files with 309825 additions and 0 deletions
7
mods/minetest_game/sethome/README.txt
Normal file
7
mods/minetest_game/sethome/README.txt
Normal file
|
@ -0,0 +1,7 @@
|
|||
Minetest Game mod: sethome
|
||||
==========================
|
||||
See license.txt for license information.
|
||||
|
||||
Authors of source code
|
||||
----------------------
|
||||
sfan5 (MIT)
|
114
mods/minetest_game/sethome/init.lua
Normal file
114
mods/minetest_game/sethome/init.lua
Normal file
|
@ -0,0 +1,114 @@
|
|||
-- sethome/init.lua
|
||||
|
||||
sethome = {}
|
||||
|
||||
-- Load support for MT game translation.
|
||||
local S = minetest.get_translator("sethome")
|
||||
|
||||
|
||||
local homes_file = minetest.get_worldpath() .. "/homes"
|
||||
local homepos = {}
|
||||
|
||||
local function loadhomes()
|
||||
local input = io.open(homes_file, "r")
|
||||
if not input then
|
||||
return -- no longer an error
|
||||
end
|
||||
|
||||
-- Iterate over all stored positions in the format "x y z player" for each line
|
||||
for pos, name in input:read("*a"):gmatch("(%S+ %S+ %S+)%s([%w_-]+)[\r\n]") do
|
||||
homepos[name] = minetest.string_to_pos(pos)
|
||||
end
|
||||
input:close()
|
||||
end
|
||||
|
||||
loadhomes()
|
||||
|
||||
sethome.set = function(name, pos)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if not player or not pos then
|
||||
return false
|
||||
end
|
||||
local player_meta = player:get_meta()
|
||||
player_meta:set_string("sethome:home", minetest.pos_to_string(pos))
|
||||
|
||||
-- remove `name` from the old storage file
|
||||
if not homepos[name] then
|
||||
return true
|
||||
end
|
||||
local data = {}
|
||||
local output = io.open(homes_file, "w")
|
||||
if output then
|
||||
homepos[name] = nil
|
||||
for i, v in pairs(homepos) do
|
||||
table.insert(data, string.format("%.1f %.1f %.1f %s\n", v.x, v.y, v.z, i))
|
||||
end
|
||||
output:write(table.concat(data))
|
||||
io.close(output)
|
||||
return true
|
||||
end
|
||||
return true -- if the file doesn't exist - don't return an error.
|
||||
end
|
||||
|
||||
sethome.get = function(name)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if not player then
|
||||
return false, S("This command can only be executed in-game!")
|
||||
end
|
||||
local player_meta = player:get_meta()
|
||||
local pos = minetest.string_to_pos(player_meta:get_string("sethome:home"))
|
||||
if pos then
|
||||
return pos
|
||||
end
|
||||
|
||||
-- fetch old entry from storage table
|
||||
pos = homepos[name]
|
||||
if pos then
|
||||
return vector.new(pos)
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
sethome.go = function(name)
|
||||
local pos = sethome.get(name)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if player and pos then
|
||||
player:set_pos(pos)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
minetest.register_privilege("home", {
|
||||
description = S("Can use /sethome and /home"),
|
||||
give_to_singleplayer = false
|
||||
})
|
||||
|
||||
minetest.register_chatcommand("home", {
|
||||
description = S("Teleport you to your home point"),
|
||||
privs = {home = true},
|
||||
func = function(name)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if not player then
|
||||
return false, S("This command can only be executed in-game!")
|
||||
end
|
||||
if sethome.go(name) then
|
||||
return true, S("Teleported to home!")
|
||||
end
|
||||
return false, S("Set a home using /sethome")
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_chatcommand("sethome", {
|
||||
description = S("Set your home point"),
|
||||
privs = {home = true},
|
||||
func = function(name)
|
||||
name = name or "" -- fallback to blank name if nil
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if player and sethome.set(name, player:get_pos()) then
|
||||
return true, S("Home set!")
|
||||
end
|
||||
return false, S("Player not found!")
|
||||
end,
|
||||
})
|
24
mods/minetest_game/sethome/license.txt
Normal file
24
mods/minetest_game/sethome/license.txt
Normal file
|
@ -0,0 +1,24 @@
|
|||
License of source code
|
||||
----------------------
|
||||
|
||||
The MIT License (MIT)
|
||||
Copyright (C) 2014-2016 sfan5
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
software and associated documentation files (the "Software"), to deal in the Software
|
||||
without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or
|
||||
substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
FOR ANY CLAIM, DAMAGES OR OTHER 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 THE SOFTWARE.
|
||||
|
||||
For more details:
|
||||
https://opensource.org/licenses/MIT
|
9
mods/minetest_game/sethome/locale/sethome.de.tr
Normal file
9
mods/minetest_game/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/minetest_game/sethome/locale/sethome.eo.tr
Normal file
9
mods/minetest_game/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/minetest_game/sethome/locale/sethome.es.tr
Normal file
9
mods/minetest_game/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/minetest_game/sethome/locale/sethome.fr.tr
Normal file
9
mods/minetest_game/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/minetest_game/sethome/locale/sethome.id.tr
Normal file
9
mods/minetest_game/sethome/locale/sethome.id.tr
Normal file
|
@ -0,0 +1,9 @@
|
|||
# textdomain: sethome
|
||||
This command can only be executed in-game!=Perintah ini hanya bisa dijalankan dalam permainan!
|
||||
Can use /sethome and /home=Boleh gunakan /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/minetest_game/sethome/locale/sethome.it.tr
Normal file
9
mods/minetest_game/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/minetest_game/sethome/locale/sethome.ja.tr
Normal file
9
mods/minetest_game/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/minetest_game/sethome/locale/sethome.jbo.tr
Normal file
9
mods/minetest_game/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/minetest_game/sethome/locale/sethome.lv.tr
Normal file
9
mods/minetest_game/sethome/locale/sethome.lv.tr
Normal file
|
@ -0,0 +1,9 @@
|
|||
# textdomain: sethome
|
||||
This command can only be executed in-game!=Šī komanda var tikt izpildīta tikai atrodoties spēlē!
|
||||
Can use /sethome and /home=Var izmantot /sethome un /home
|
||||
Teleport you to your home point=Teleportēt jūs uz mājas punktu
|
||||
Teleported to home!=Esiet teleportēts mājās!
|
||||
Set a home using /sethome=Uzstādiet māju punktu izmantojot /sethome
|
||||
Set your home point=Uzstādiet savu mājas punktu
|
||||
Home set!=Mājas punkts uzstādīts!
|
||||
Player not found!=Spēlētājs nav atrasts!
|
9
mods/minetest_game/sethome/locale/sethome.ms.tr
Normal file
9
mods/minetest_game/sethome/locale/sethome.ms.tr
Normal file
|
@ -0,0 +1,9 @@
|
|||
# textdomain: sethome
|
||||
This command can only be executed in-game!=Perintah ini hanya boleh dijalankan dalam permainan!
|
||||
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/minetest_game/sethome/locale/sethome.pl.tr
Normal file
9
mods/minetest_game/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/minetest_game/sethome/locale/sethome.pt_BR.tr
Normal file
9
mods/minetest_game/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/minetest_game/sethome/locale/sethome.ru.tr
Normal file
9
mods/minetest_game/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!=Игрок не найден!
|
9
mods/minetest_game/sethome/locale/sethome.sk.tr
Normal file
9
mods/minetest_game/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/minetest_game/sethome/locale/sethome.sv.tr
Normal file
9
mods/minetest_game/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/minetest_game/sethome/locale/sethome.uk.tr
Normal file
9
mods/minetest_game/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/minetest_game/sethome/locale/sethome.zh_CN.tr
Normal file
9
mods/minetest_game/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/minetest_game/sethome/locale/sethome.zh_TW.tr
Normal file
9
mods/minetest_game/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/minetest_game/sethome/locale/template.txt
Normal file
9
mods/minetest_game/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/minetest_game/sethome/mod.conf
Normal file
2
mods/minetest_game/sethome/mod.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
name = sethome
|
||||
description = Minetest Game mod: sethome
|
Loading…
Add table
Add a link
Reference in a new issue