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

@ -194,3 +194,14 @@ end
function mcl_util.is_fuel(item)
return minetest.get_craft_result({method="fuel", width=1, items={item}}).time ~= 0
end
-- For a given position, returns a 2-tuple:
-- 1st return value: true if pos is in void
-- 2nd return value: true if it is in the deadly part of the void
function mcl_util.is_in_void(pos)
local void, void_deadly
void = pos.y < mcl_vars.bedrock_overworld_min
void_deadly = pos.y < mcl_vars.bedrock_overworld_min - 65
return void, void_deadly
end