mirror of
https://codeberg.org/tenplus1/teleport_potion.git
synced 2025-03-15 06:01:24 +00:00
new pad texture, 5.x changes
This commit is contained in:
parent
a13eaf700c
commit
6f66ea9c7d
4 changed files with 14 additions and 13 deletions
|
@ -7,6 +7,7 @@ https://forum.minetest.net/viewtopic.php?f=9&t=9234
|
|||
|
||||
Change log:
|
||||
|
||||
- 1.2 - New teleport pad texture, code tweaks to work with minetest 5.x
|
||||
- 1.1 - Using 0.4.16+ code changes, can only teleport players now, added MineClone2 crafts and spanish translation
|
||||
- 1.0 - Added changes by maybe_dragon to bookmark teleport destination before using pads and potions
|
||||
- 0.9 - Update to newer functions, requires Minetest 0.4.16 to work.
|
||||
|
|
26
init.lua
26
init.lua
|
@ -1,13 +1,13 @@
|
|||
|
||||
--= Teleport Potion mod by TenPlus1
|
||||
--= Teleport Potion mod by TenPlus1 (SFX are license free)
|
||||
|
||||
-- Create teleport potion or pad, place then right-click to enter coords
|
||||
-- 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...
|
||||
-- Craft teleport potion or pad, use to bookmark location, place to open
|
||||
-- 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, NS = dofile(MP.."/intllib.lua")
|
||||
local S, NS = dofile(MP .. "/intllib.lua")
|
||||
|
||||
-- check for MineClone2
|
||||
local mcl = minetest.get_modpath("mcl_core")
|
||||
|
@ -83,7 +83,7 @@ local function set_teleport_destination(playername, dest)
|
|||
pos = dest,
|
||||
gain = 1.0,
|
||||
max_hear_distance = 10
|
||||
})
|
||||
}, true)
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -122,7 +122,7 @@ minetest.register_node("teleport_potion:portal", {
|
|||
pos = pos,
|
||||
gain = 1.0,
|
||||
max_hear_distance = 10
|
||||
})
|
||||
}, true)
|
||||
|
||||
minetest.remove_node(pos)
|
||||
end,
|
||||
|
@ -167,7 +167,7 @@ local potion_entity = {
|
|||
visual = "sprite",
|
||||
visual_size = {x = 1.0, y = 1.0},
|
||||
textures = {"potion.png"},
|
||||
collisionbox = {0,0,0,0,0,0},
|
||||
collisionbox = {-0.1,-0.1,-0.1,0.1,0.1,0.1},
|
||||
lastpos = {},
|
||||
player = "",
|
||||
}
|
||||
|
@ -201,7 +201,7 @@ potion_entity.on_step = function(self, dtime)
|
|||
pos = self.lastpos,
|
||||
gain = 1.0,
|
||||
max_hear_distance = 5
|
||||
})
|
||||
}, true)
|
||||
|
||||
tp_effect(self.lastpos)
|
||||
end
|
||||
|
@ -223,7 +223,7 @@ minetest.register_entity("teleport_potion:potion_entity", potion_entity)
|
|||
--- Teleport potion
|
||||
--------------------------------------------------------------------------------
|
||||
minetest.register_node("teleport_potion:potion", {
|
||||
tiles = {"pad.png"},
|
||||
tiles = {"potion.png"},
|
||||
drawtype = "signlike",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
|
@ -347,7 +347,7 @@ minetest.register_node("teleport_potion:pad", {
|
|||
pos = pos,
|
||||
gain = 1.0,
|
||||
max_hear_distance = 10
|
||||
})
|
||||
}, true)
|
||||
end,
|
||||
|
||||
-- Show formspec depending on the players privileges.
|
||||
|
@ -475,7 +475,7 @@ minetest.register_abm({
|
|||
pos = pos,
|
||||
gain = 1.0,
|
||||
max_hear_distance = 5
|
||||
})
|
||||
}, true)
|
||||
|
||||
-- move player
|
||||
objs[n]:set_pos(target_coords)
|
||||
|
@ -488,7 +488,7 @@ minetest.register_abm({
|
|||
pos = target_coords,
|
||||
gain = 1.0,
|
||||
max_hear_distance = 5
|
||||
})
|
||||
}, true)
|
||||
|
||||
-- rotate player to look in pad placement direction
|
||||
local rot = node.param2
|
||||
|
|
BIN
textures/pad.png
BIN
textures/pad.png
Binary file not shown.
Before Width: | Height: | Size: 334 B |
Binary file not shown.
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 266 B |
Loading…
Add table
Reference in a new issue