mcl_util.is_in_void

This commit is contained in:
Wuzzy 2017-02-21 16:38:28 +01:00
parent c866227d54
commit 2e7ce77985
3 changed files with 14 additions and 1 deletions

View file

@ -1,3 +1,4 @@
mcl_init
mcl_util
mcl_core
3d_armor?

View file

@ -129,7 +129,8 @@ minetest.register_globalstep(function(dtime)
-- This only works beause weather_pack currently does not touch the sky for players below the height used for this check.
-- There should be a real skybox API.
end
if pos.y < mcl_vars.bedrock_overworld_min - 65 then
local void, void_deadly = mcl_util.is_in_void(pos)
if void_deadly then
-- Player is deep into the void, deal void damage
if player:get_hp() > 0 then
player:set_hp(player:get_hp() - 4)