From aa5ef41015c2bebe3650ad03cdaf8072f3a2e8fb Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 20 Feb 2017 07:10:03 +0100 Subject: [PATCH] Globalize bedrock generation position --- mods/CORE/mcl_init/init.lua | 3 +++ mods/MAPGEN/mcl_mapgen_core/depends.txt | 1 + mods/MAPGEN/mcl_mapgen_core/init.lua | 4 ++-- mods/PLAYER/playerplus/depends.txt | 1 + mods/PLAYER/playerplus/init.lua | 4 ++-- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/mods/CORE/mcl_init/init.lua b/mods/CORE/mcl_init/init.lua index d1b519f6ef..01bcc84420 100644 --- a/mods/CORE/mcl_init/init.lua +++ b/mods/CORE/mcl_init/init.lua @@ -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 diff --git a/mods/MAPGEN/mcl_mapgen_core/depends.txt b/mods/MAPGEN/mcl_mapgen_core/depends.txt index 3851200f92..de9a5352cd 100644 --- a/mods/MAPGEN/mcl_mapgen_core/depends.txt +++ b/mods/MAPGEN/mcl_mapgen_core/depends.txt @@ -1,3 +1,4 @@ +mcl_init mcl_core stairs random_struct diff --git a/mods/MAPGEN/mcl_mapgen_core/init.lua b/mods/MAPGEN/mcl_mapgen_core/init.lua index a71e62251c..2eb57de62c 100644 --- a/mods/MAPGEN/mcl_mapgen_core/init.lua +++ b/mods/MAPGEN/mcl_mapgen_core/init.lua @@ -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 diff --git a/mods/PLAYER/playerplus/depends.txt b/mods/PLAYER/playerplus/depends.txt index 4d8db0deb7..149d813a30 100644 --- a/mods/PLAYER/playerplus/depends.txt +++ b/mods/PLAYER/playerplus/depends.txt @@ -1,2 +1,3 @@ +mcl_init mcl_core 3d_armor? diff --git a/mods/PLAYER/playerplus/init.lua b/mods/PLAYER/playerplus/init.lua index 298651daa0..0f6b9002d7 100644 --- a/mods/PLAYER/playerplus/init.lua +++ b/mods/PLAYER/playerplus/init.lua @@ -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)