mirror of
https://github.com/HybridDog/nether-pack.git
synced 2025-01-28 10:20:19 +01:00
Fixed multiple teleportation!!
This commit is contained in:
parent
d707f0a6a3
commit
462eebe11b
@ -803,10 +803,15 @@ minetest.register_abm({
|
|||||||
local objpos = obj:getpos()
|
local objpos = obj:getpos()
|
||||||
local objmeta = minetest.env:get_meta(objpos)
|
local objmeta = minetest.env:get_meta(objpos)
|
||||||
if objpos.y>pos.y-1 and objpos.y<pos.y and obj:get_player_name() ~= nil and obj:get_player_name() ~= "" then
|
if objpos.y>pos.y-1 and objpos.y<pos.y and obj:get_player_name() ~= nil and obj:get_player_name() ~= "" then
|
||||||
if objmeta:get_string("teleporting") == "" or objmeta:get_string("teleporting") == nil then
|
local innether = nether:inside_nether(obj:getpos())
|
||||||
objmeta:set_string("teleporting", "true")
|
if innether == true and (objmeta:get_string("teleportingfromnether") == "" or objmeta:get_string("teleportingfromnether") == nil) then
|
||||||
nether:teleport_player(nether:inside_nether(obj:getpos()), obj)
|
objmeta:set_string("teleportingfromnether", "true")
|
||||||
objmeta:set_string("teleporting", "")
|
objmeta:set_string("teleportingtonether", "")
|
||||||
|
nether:teleport_player(innether, obj)
|
||||||
|
elseif innether == false and (objmeta:get_string("teleportingtonether") == "" or objmeta:get_string("teleportingtonether") == nil) then
|
||||||
|
objmeta:set_string("teleportingtonether", "true")
|
||||||
|
objmeta:set_string("teleportingfromnether", "")
|
||||||
|
nether:teleport_player(innether, obj)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -423,7 +423,7 @@ minetest.register_node("nether:nether_torch_bottom", {
|
|||||||
minetest.register_craftitem("nether:nether_pearl", {
|
minetest.register_craftitem("nether:nether_pearl", {
|
||||||
description = "Nether Pearl",
|
description = "Nether Pearl",
|
||||||
wield_image = "nether_pearl.png",
|
wield_image = "nether_pearl.png",
|
||||||
wield_image = "nether_pearl.png",
|
inventory_image = "nether_pearl.png",
|
||||||
visual = "sprite",
|
visual = "sprite",
|
||||||
physical = true,
|
physical = true,
|
||||||
textures = {"nether_pearl.png"},
|
textures = {"nether_pearl.png"},
|
||||||
@ -803,10 +803,15 @@ minetest.register_abm({
|
|||||||
local objpos = obj:getpos()
|
local objpos = obj:getpos()
|
||||||
local objmeta = minetest.env:get_meta(objpos)
|
local objmeta = minetest.env:get_meta(objpos)
|
||||||
if objpos.y>pos.y-1 and objpos.y<pos.y and obj:get_player_name() ~= nil and obj:get_player_name() ~= "" then
|
if objpos.y>pos.y-1 and objpos.y<pos.y and obj:get_player_name() ~= nil and obj:get_player_name() ~= "" then
|
||||||
if objmeta:get_string("teleporting") == "" or objmeta:get_string("teleporting") == nil then
|
local innether = nether:inside_nether(obj:getpos())
|
||||||
objmeta:set_string("teleporting", "true")
|
if innether == true and (objmeta:get_string("teleportingfromnether") == "" or objmeta:get_string("teleportingfromnether") == nil) then
|
||||||
nether:teleport_player(nether:inside_nether(obj:getpos()), obj)
|
objmeta:set_string("teleportingfromnether", "true")
|
||||||
objmeta:set_string("teleporting", "")
|
objmeta:set_string("teleportingtonether", "")
|
||||||
|
nether:teleport_player(innether, obj)
|
||||||
|
elseif innether == false and (objmeta:get_string("teleportingfromnether") == "" or objmeta:get_string("teleportingfromnether") == nil) then
|
||||||
|
objmeta:set_string("teleportingtonether", "true")
|
||||||
|
objmeta:set_string("teleportingfromnether", "")
|
||||||
|
nether:teleport_player(innether, obj)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user