mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-24 01:30:38 +01:00
Applying our own changes
- Nether apple giving 9 of hunger - Come back in real world at static_spawnpoint or MFF's spawnpoint
This commit is contained in:
parent
c6c301ec54
commit
577bcbf470
@ -366,6 +366,14 @@ minetest.register_node("nether:apple", {
|
||||
if nether_port(user, vector.round(user:getpos())) then
|
||||
return itemstack
|
||||
end
|
||||
|
||||
local p_hunger = tonumber(hud.hunger[user:get_player_name()])
|
||||
if not p_hunger then return end
|
||||
p_hunger = p_hunger+9
|
||||
if p_hunger > 30 then p_hunger = 30 end
|
||||
hud.hunger[user:get_player_name()] = p_hunger
|
||||
hud.set_hunger(user)
|
||||
|
||||
local amount = math.random(4, 6)
|
||||
inv:add_item("main", {name="nether:blood_extracted", count=math.floor(amount/3)})
|
||||
user:set_hp(user:get_hp()-amount)
|
||||
|
@ -534,7 +534,13 @@ 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=pos.x, y=100, z=pos.z})
|
||||
local pos_togo = {x = 0, y = 35, z = -7}
|
||||
if minetest.setting_getbool("static_spawnpoint") ~= nil then
|
||||
local 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
|
||||
table.foreach(pos_togo,print)
|
||||
player:moveto(pos_togo)
|
||||
else
|
||||
player:moveto({x=pos.x, y=portal_target+math.random(4), z=pos.z})
|
||||
player_to_nether(player, true)
|
||||
|
Loading…
Reference in New Issue
Block a user