Use the beds spawn table for /setspawn.
This commit is contained in:
parent
fdd130c1a5
commit
e43aa31279
3 changed files with 2 additions and 10 deletions
2
chat.lua
2
chat.lua
|
@ -27,7 +27,7 @@ minetest.register_chatcommand("setspawn", {
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
local pos = player:getpos()
|
local pos = player:getpos()
|
||||||
fun_caves.db.spawn[name] = pos
|
beds.spawn[name] = pos
|
||||||
minetest.chat_send_player(name, 'Your spawn position has been changed.')
|
minetest.chat_send_player(name, 'Your spawn position has been changed.')
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
|
@ -2,6 +2,7 @@ default
|
||||||
flowers
|
flowers
|
||||||
wool
|
wool
|
||||||
bucket
|
bucket
|
||||||
|
beds
|
||||||
hunger?
|
hunger?
|
||||||
mobs?
|
mobs?
|
||||||
mobs_monster?
|
mobs_monster?
|
||||||
|
|
9
init.lua
9
init.lua
|
@ -115,15 +115,6 @@ end
|
||||||
--fun_caves.print_recipes()
|
--fun_caves.print_recipes()
|
||||||
|
|
||||||
|
|
||||||
minetest.register_on_respawnplayer(function(player)
|
|
||||||
local name = player:get_player_name()
|
|
||||||
if fun_caves.db.spawn[name] then
|
|
||||||
player:setpos(fun_caves.db.spawn[name])
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
|
|
||||||
local hunger_mod = minetest.get_modpath("hunger")
|
local hunger_mod = minetest.get_modpath("hunger")
|
||||||
fun_caves.hunger_id = {}
|
fun_caves.hunger_id = {}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue