mirror of
https://codeberg.org/tenplus1/teleport_potion.git
synced 2025-07-16 03:06:44 -04:00
remove intllib support
This commit is contained in:
parent
787edfd305
commit
2455809475
8 changed files with 21 additions and 182 deletions
25
init.lua
25
init.lua
|
@ -5,11 +5,25 @@
|
|||
-- portal or place pad, portals show a blue flame that you can walk into
|
||||
-- before it closes (10 seconds), potions can also be thrown for local teleport.
|
||||
|
||||
|
||||
-- Load support for intllib.
|
||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||
local S = minetest.get_translator and minetest.get_translator("teleport_potion") or
|
||||
dofile(MP .. "/intllib.lua")
|
||||
-- translation support
|
||||
local S
|
||||
if minetest.get_translator then
|
||||
S = minetest.get_translator("teleport_potion")
|
||||
else
|
||||
S = function(s, a, ...)
|
||||
if a == nil then
|
||||
return s
|
||||
end
|
||||
a = {a, ...}
|
||||
return s:gsub("(@?)@(%(?)(%d+)(%)?)", function(e, o, n, c)
|
||||
if e == ""then
|
||||
return a[tonumber(n)] .. (o == "" and c or "")
|
||||
else
|
||||
return "@" .. o .. n .. c
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
-- check for MineClone2
|
||||
local mcl = minetest.get_modpath("mcl_core")
|
||||
|
@ -562,4 +576,5 @@ if minetest.get_modpath("lucky_block") then
|
|||
})
|
||||
end
|
||||
|
||||
|
||||
print ("[MOD] Teleport Potion loaded")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue