new pad texture, 5.x changes

This commit is contained in:
TenPlus1 2020-04-30 20:24:58 +01:00
parent a13eaf700c
commit 6f66ea9c7d
4 changed files with 14 additions and 13 deletions

View file

@ -7,6 +7,7 @@ https://forum.minetest.net/viewtopic.php?f=9&t=9234
Change log: 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.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 - 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. - 0.9 - Update to newer functions, requires Minetest 0.4.16 to work.

View file

@ -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 -- Craft teleport potion or pad, use to bookmark location, place to open
-- and step onto pad or walk into the blue portal light, portal closes after -- portal or place pad, portals show a blue flame that you can walk into
-- 10 seconds, pad remains, potions are throwable... SFX are license Free... -- before it closes (10 seconds), potions can also be thrown for local teleport.
-- Load support for intllib. -- Load support for intllib.
local MP = minetest.get_modpath(minetest.get_current_modname()) 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 -- check for MineClone2
local mcl = minetest.get_modpath("mcl_core") local mcl = minetest.get_modpath("mcl_core")
@ -83,7 +83,7 @@ local function set_teleport_destination(playername, dest)
pos = dest, pos = dest,
gain = 1.0, gain = 1.0,
max_hear_distance = 10 max_hear_distance = 10
}) }, true)
end end
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -122,7 +122,7 @@ minetest.register_node("teleport_potion:portal", {
pos = pos, pos = pos,
gain = 1.0, gain = 1.0,
max_hear_distance = 10 max_hear_distance = 10
}) }, true)
minetest.remove_node(pos) minetest.remove_node(pos)
end, end,
@ -167,7 +167,7 @@ local potion_entity = {
visual = "sprite", visual = "sprite",
visual_size = {x = 1.0, y = 1.0}, visual_size = {x = 1.0, y = 1.0},
textures = {"potion.png"}, textures = {"potion.png"},
collisionbox = {0,0,0,0,0,0}, collisionbox = {-0.1,-0.1,-0.1,0.1,0.1,0.1},
lastpos = {}, lastpos = {},
player = "", player = "",
} }
@ -201,7 +201,7 @@ potion_entity.on_step = function(self, dtime)
pos = self.lastpos, pos = self.lastpos,
gain = 1.0, gain = 1.0,
max_hear_distance = 5 max_hear_distance = 5
}) }, true)
tp_effect(self.lastpos) tp_effect(self.lastpos)
end end
@ -223,7 +223,7 @@ minetest.register_entity("teleport_potion:potion_entity", potion_entity)
--- Teleport potion --- Teleport potion
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
minetest.register_node("teleport_potion:potion", { minetest.register_node("teleport_potion:potion", {
tiles = {"pad.png"}, tiles = {"potion.png"},
drawtype = "signlike", drawtype = "signlike",
paramtype = "light", paramtype = "light",
paramtype2 = "wallmounted", paramtype2 = "wallmounted",
@ -347,7 +347,7 @@ minetest.register_node("teleport_potion:pad", {
pos = pos, pos = pos,
gain = 1.0, gain = 1.0,
max_hear_distance = 10 max_hear_distance = 10
}) }, true)
end, end,
-- Show formspec depending on the players privileges. -- Show formspec depending on the players privileges.
@ -475,7 +475,7 @@ minetest.register_abm({
pos = pos, pos = pos,
gain = 1.0, gain = 1.0,
max_hear_distance = 5 max_hear_distance = 5
}) }, true)
-- move player -- move player
objs[n]:set_pos(target_coords) objs[n]:set_pos(target_coords)
@ -488,7 +488,7 @@ minetest.register_abm({
pos = target_coords, pos = target_coords,
gain = 1.0, gain = 1.0,
max_hear_distance = 5 max_hear_distance = 5
}) }, true)
-- rotate player to look in pad placement direction -- rotate player to look in pad placement direction
local rot = node.param2 local rot = node.param2

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