Globalize bedrock generation position

This commit is contained in:
Wuzzy 2017-02-20 07:10:03 +01:00
parent 0f2787cd16
commit aa5ef41015
5 changed files with 9 additions and 4 deletions

View file

@ -8,6 +8,9 @@ mcl_vars.gui_bg_img = ""
mcl_vars.inventory_header = mcl_vars.gui_slots .. mcl_vars.gui_bg
mcl_vars.bedrock_overworld_min = -62
mcl_vars.bedrock_overworld_max = -58
-- Set default stack sizes
minetest.nodedef_default.stack_max = 64
minetest.craftitemdef_default.stack_max = 64

View file

@ -1,3 +1,4 @@
mcl_init
mcl_core
stairs
random_struct

View file

@ -468,8 +468,8 @@ end)
-- Generate 5 layers of bedrock, with increasing levels of roughness, until a perfecly flat bedrock later at the bottom layer
local BEDROCK_MIN = -66
local BEDROCK_MAX = -62
local BEDROCK_MIN = mcl_vars.bedrock_overworld_min
local BEDROCK_MAX = mcl_vars.bedrock_overworld_max
-- Below the bedrock, generate air/void

View file

@ -1,2 +1,3 @@
mcl_init
mcl_core
3d_armor?

View file

@ -116,13 +116,13 @@ minetest.register_globalstep(function(dtime)
end
-- Apply black sky in the Void and deal Void damage
if pos.y < -64 then
if pos.y < mcl_vars.bedrock_overworld_max 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
if pos.y < mcl_vars.bedrock_overworld_min - 65 then
-- Player is deep into the void, deal void damage
if player:get_hp() > 0 then
player:set_hp(player:get_hp() - 4)