mirror of
https://codeberg.org/tenplus1/teleport_potion.git
synced 2025-03-22 17:32:22 +00:00
Teleport sound plays both sides of portal
This commit is contained in:
parent
26bc25b5af
commit
0a633d42ef
1 changed files with 3 additions and 2 deletions
5
init.lua
5
init.lua
|
@ -13,7 +13,7 @@ minetest.register_craft({
|
||||||
recipe = {'vessels:glass_bottle', 'default:diamondblock'}
|
recipe = {'vessels:glass_bottle', 'default:diamondblock'}
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Teleport Pad recipe
|
--[[ Teleport Pad recipe
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'teleport_potion:pad',
|
output = 'teleport_potion:pad',
|
||||||
recipe = {
|
recipe = {
|
||||||
|
@ -21,7 +21,7 @@ minetest.register_craft({
|
||||||
{"default:glass", "default:mese", "default:glass"},
|
{"default:glass", "default:mese", "default:glass"},
|
||||||
{"teleport_potion:potion", "default:glass", "teleport_potion:potion"}
|
{"teleport_potion:potion", "default:glass", "teleport_potion:potion"}
|
||||||
}
|
}
|
||||||
})
|
})]]
|
||||||
|
|
||||||
-- Default coords
|
-- Default coords
|
||||||
teleport.default = {x=0, y=0, z=0}
|
teleport.default = {x=0, y=0, z=0}
|
||||||
|
@ -233,6 +233,7 @@ minetest.register_abm({
|
||||||
target_coords={x=meta:get_float("x"), y=meta:get_float("y"), z=meta:get_float("z")}
|
target_coords={x=meta:get_float("x"), y=meta:get_float("y"), z=meta:get_float("z")}
|
||||||
minetest.sound_play("portal_close", {pos = pos, gain = 1.0, max_hear_distance = 5,})
|
minetest.sound_play("portal_close", {pos = pos, gain = 1.0, max_hear_distance = 5,})
|
||||||
player:moveto(target_coords, false)
|
player:moveto(target_coords, false)
|
||||||
|
minetest.sound_play("portal_close", {pos = target_coords, gain = 1.0, max_hear_distance = 5,})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue