1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-06-28 06:11:47 +02:00

[conf & h2omes & nether] Add nether static spawnpoint

This commit is contained in:
LeMagnesium
2016-06-08 18:16:18 +02:00
parent b1adb55c11
commit 76bc4b0330
3 changed files with 49 additions and 20 deletions

View File

@ -355,7 +355,17 @@ minetest.register_privilege("home", "Can use /sethome, /home, /setpit and /pit")
minetest.register_chatcommand("spawn", {
description = "Teleport a player to the defined spawnpoint",
func = function(name)
local to_pos = minetest.setting_get_pos("static_spawnpoint")
local to_pos
if minetest.get_modpath("nether") ~= nil and table.icontains(nether.players_in_nether, name) then
if nether.spawn_point then
to_pos = nether.spawn_point
end
-- Otherwise error about no spawn
else
to_pos = minetest.setting_get_pos("static_spawnpoint")
end
if not to_pos then
minetest.chat_send_player(name, "ERROR: No spawn point is set on this server!")
return false