Handle player void handling in playerplus

This commit is contained in:
Wuzzy 2017-02-20 06:56:17 +01:00
parent 0b375f00cd
commit 0f2787cd16
3 changed files with 21 additions and 30 deletions

View file

@ -115,6 +115,20 @@ minetest.register_globalstep(function(dtime)
end
-- Apply black sky in the Void and deal Void damage
if pos.y < -64 then
-- Player reached the void, set black sky box
player:set_sky("#000000", "plain")
else
player:set_sky(nil, "regular")
end
if pos.y < -64 -64 then
-- Player is deep into the void, deal void damage
if player:get_hp() > 0 then
player:set_hp(player:get_hp() - 4)
end
end
end
end)