diff --git a/README.md b/README.md index 5be82d0..96f647f 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/init.lua b/init.lua index 899be9c..ab865aa 100644 --- a/init.lua +++ b/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 diff --git a/textures/pad.png b/textures/pad.png deleted file mode 100644 index a9525ef..0000000 Binary files a/textures/pad.png and /dev/null differ diff --git a/textures/padd.png b/textures/padd.png index 0f7c937..8ec6906 100644 Binary files a/textures/padd.png and b/textures/padd.png differ