Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
teleport_potion
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
teleport_potion
Commits
7c8b2dde
Commit
7c8b2dde
authored
8 years ago
by
TenPlus1
Browse files
Options
Downloads
Patches
Plain Diff
intllib support added (thanks Xanthin)
parent
718adac0
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
depends.txt
+2
-1
2 additions, 1 deletion
depends.txt
init.lua
+34
-13
34 additions, 13 deletions
init.lua
locale/de.txt
+14
-0
14 additions, 0 deletions
locale/de.txt
locale/template.txt
+12
-0
12 additions, 0 deletions
locale/template.txt
with
62 additions
and
14 deletions
depends.txt
+
2
−
1
View file @
7c8b2dde
default
vessels
\ No newline at end of file
vessels
intllib?
This diff is collapsed.
Click to expand it.
init.lua
+
34
−
13
View file @
7c8b2dde
...
...
@@ -5,6 +5,27 @@
-- and step onto pad or walk into the blue portal light, portal closes after
-- 10 seconds, pad remains, potions are throwable... SFX are license Free...
-- Intllib
local
S
if
minetest
.
get_modpath
(
"intllib"
)
then
S
=
intllib
.
Getter
()
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
-- max teleport distance
local
dist
=
tonumber
(
minetest
.
setting_get
(
"map_generation_limit"
)
or
31000
)
...
...
@@ -107,7 +128,7 @@ minetest.register_node("teleport_potion:potion", {
paramtype2
=
"wallmounted"
,
walkable
=
false
,
sunlight_propagates
=
true
,
description
=
"Teleport Potion (place and right-click to enchant location)"
,
description
=
S
(
"Teleport Potion (place and right-click to enchant location)"
)
,
inventory_image
=
"potion.png"
,
wield_image
=
"potion.png"
,
groups
=
{
dig_immediate
=
3
},
...
...
@@ -118,8 +139,8 @@ minetest.register_node("teleport_potion:potion", {
local
meta
=
minetest
.
get_meta
(
pos
)
-- text entry formspec
meta
:
set_string
(
"formspec"
,
"field[text;Enter teleport coords (e.g. 200,20,-200);${text}]"
)
meta
:
set_string
(
"infotext"
,
"Right-click to enchant teleport location"
)
meta
:
set_string
(
"formspec"
,
"field[text;
"
..
S
(
"
Enter teleport coords (e.g. 200,20,-200)
"
)
..
"
;${text}]"
)
meta
:
set_string
(
"infotext"
,
S
(
"Right-click to enchant teleport location"
)
)
meta
:
set_string
(
"text"
,
pos
.
x
..
","
..
pos
.
y
..
","
..
pos
.
z
)
-- set default coords
...
...
@@ -166,16 +187,16 @@ minetest.register_node("teleport_potion:potion", {
})
else
minetest
.
chat_send_player
(
name
,
'
Potion failed!
'
)
minetest
.
chat_send_player
(
name
,
S
(
"
Potion failed!
"
)
)
minetest
.
set_node
(
pos
,
{
name
=
"air"
})
minetest
.
add_item
(
pos
,
'
teleport_potion:potion
'
)
minetest
.
add_item
(
pos
,
"
teleport_potion:potion
"
)
end
end
,
})
-- teleport potion recipe
minetest
.
register_craft
({
output
=
'
teleport_potion:potion
'
,
output
=
"
teleport_potion:potion
"
,
recipe
=
{
{
""
,
"default:diamond"
,
""
},
{
"default:diamond"
,
"vessels:glass_bottle"
,
"default:diamond"
},
...
...
@@ -192,7 +213,7 @@ minetest.register_node("teleport_potion:pad", {
legacy_wallmounted
=
true
,
walkable
=
true
,
sunlight_propagates
=
true
,
description
=
"Teleport Pad (place and right-click to enchant location)"
,
description
=
S
(
"Teleport Pad (place and right-click to enchant location)"
)
,
inventory_image
=
"padd.png"
,
wield_image
=
"padd.png"
,
light_source
=
5
,
...
...
@@ -210,8 +231,8 @@ minetest.register_node("teleport_potion:pad", {
local
meta
=
minetest
.
get_meta
(
pos
)
-- text entry formspec
meta
:
set_string
(
"formspec"
,
"field[text;Enter teleport coords (e.g. 200,20,-200,Home);${text}]"
)
meta
:
set_string
(
"infotext"
,
"Right-click to enchant teleport location"
)
meta
:
set_string
(
"formspec"
,
"field[text;
"
..
S
(
"
Enter teleport coords (e.g. 200,20,-200,Home)
"
)
..
"
;${text}]"
)
meta
:
set_string
(
"infotext"
,
S
(
"Right-click to enchant teleport location"
)
)
meta
:
set_string
(
"text"
,
pos
.
x
..
","
..
pos
.
y
..
","
..
pos
.
z
)
-- set default coords
...
...
@@ -243,10 +264,10 @@ minetest.register_node("teleport_potion:pad", {
if
coords
.
desc
and
coords
.
desc
~=
""
then
meta
:
set_string
(
"infotext"
,
"Teleport to
"
..
coords
.
desc
)
meta
:
set_string
(
"infotext"
,
S
(
"Teleport to
@1"
,
coords
.
desc
)
)
else
meta
:
set_string
(
"infotext"
,
"Pad Active (
"
..
coords
.
x
..
","
..
coords
.
y
..
","
..
coords
.
z
..
")"
)
meta
:
set_string
(
"infotext"
,
S
(
"Pad Active (
@1,@2,@3)"
,
coords
.
x
,
coords
.
y
,
coords
.
z
)
)
end
minetest
.
sound_play
(
"portal_open"
,
{
...
...
@@ -256,7 +277,7 @@ minetest.register_node("teleport_potion:pad", {
})
else
minetest
.
chat_send_player
(
name
,
'
Teleport Pad coordinates failed!
'
)
minetest
.
chat_send_player
(
name
,
S
(
"
Teleport Pad coordinates failed!
"
)
)
end
end
,
})
...
...
This diff is collapsed.
Click to expand it.
locale/de.txt
0 → 100644
+
14
−
0
View file @
7c8b2dde
# German Translation for teleport_potion mod
# Deutsche Übersetzung der teleport_potion Mod
# last update: 2016/May/27
# Author: Xanthin
Teleport Potion (place and right-click to enchant location) = Teleportationstrank (platzieren und rechtsklicken,\num Standort zu verzaubern)
Enter teleport coords (e.g. 200,20,-200) = Koordinaten eingeben (z.B. 200,20,-200)
Right-click to enchant teleport location = Rechtsklick um Teleportationsort zu verzaubern
Potion failed! = Trank misslungen!
Teleport Pad (place and right-click to enchant location) = Teleportationsfeld (platzieren und rechtsklicken,\num Standort zu verzaubern)
Enter teleport coords (e.g. 200,20,-200,Home) = Koordinaten eingeben (z.B. 200,20,-200,Haus)
Teleport to @1 = Teleportiere nach @1
Pad Active (@1,@2,@3) = Feld aktiv (@1,@2,@3)
Teleport Pad coordinates failed! = Teleportationsfeldkoordinaten fehlgeschlagen!
\ No newline at end of file
This diff is collapsed.
Click to expand it.
locale/template.txt
0 → 100644
+
12
−
0
View file @
7c8b2dde
# Template for translations of teleport_potion mod
# last update: 2016/May/27
Teleport Potion (place and right-click to enchant location) =
Enter teleport coords (e.g. 200,20,-200) =
Right-click to enchant teleport location =
Potion failed! =
Teleport Pad (place and right-click to enchant location) =
Enter teleport coords (e.g. 200,20,-200,Home) =
Teleport to @1 =
Pad Active (@1,@2,@3) =
Teleport Pad coordinates failed! =
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment