From ccccd48a63a80f84b67958ccfb1af18c1b1c6f19 Mon Sep 17 00:00:00 2001 From: LeMagnesium Date: Mon, 24 Nov 2014 22:52:28 +0100 Subject: [PATCH] Using static_spawnpoint in minetest.conf - When return back from the nether, the player is teleported either to 5, 35, -7 (something like that), or to the defined value of static_spawnpoint key in minetest.conf. --- mods/nether/nether/portal.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mods/nether/nether/portal.lua b/mods/nether/nether/portal.lua index 49fe196..5949366 100644 --- a/mods/nether/nether/portal.lua +++ b/mods/nether/nether/portal.lua @@ -522,7 +522,12 @@ function nether_port(player, pos) minetest.sound_play("nether_teleporter", {pos=pos}) if pos.y < nether.start then player_from_nether(player) - player:moveto({x=5, y=35, z=-7}) + local pos_togo = {x = 0, y = 35, z = -7} + if minetest.setting_getbool("static_spawnpoint") ~= nil then + stsp_conf = minetest.setting_get("static_spawnpoint") + pos_togo = {x = stsp_conf:split(",")[1],y = stsp_conf:split(",")[2],z = stsp_conf:split(",")[3]} + end + player:moveto(pos_togo) else player:moveto({x=pos.x, y=portal_target+math.random(4), z=pos.z}) player_to_nether(player, true)