From edde01d582af92d3aff6533d323f688fa020ec02 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 21 Feb 2017 04:20:43 +0100 Subject: [PATCH] Fix weather sky color issues But also disable void blackness --- mods/ENVIRONMENT/lightning/init.lua | 12 +++++------- mods/PLAYER/playerplus/init.lua | 3 +++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/mods/ENVIRONMENT/lightning/init.lua b/mods/ENVIRONMENT/lightning/init.lua index 6880cf106..25d4f8496 100644 --- a/mods/ENVIRONMENT/lightning/init.lua +++ b/mods/ENVIRONMENT/lightning/init.lua @@ -25,19 +25,16 @@ local rng = PcgRandom(32321123312123) local ps = {} local ttl = 1 -local revertsky = function() +local revertsky = function(dtime) if ttl == 0 then return end - ttl = ttl - 1 + ttl = ttl - dtime if ttl > 0 then return end - for key, entry in pairs(ps) do - local sky = entry.sky - entry.p:set_sky(sky.bgcolor, sky.type, sky.textures) - end + skycolor.remove_layer("lightning") ps = {} end @@ -139,7 +136,8 @@ lightning.strike = function(pos) local name = player:get_player_name() if ps[name] == nil then ps[name] = {p = player, sky = sky} - player:set_sky(0xffffff, "plain", {}) + skycolor.add_layer("lightning", {{r=255,g=255,b=255}}) + skycolor.active = true end end diff --git a/mods/PLAYER/playerplus/init.lua b/mods/PLAYER/playerplus/init.lua index 3e3653d7b..1de8ee45b 100644 --- a/mods/PLAYER/playerplus/init.lua +++ b/mods/PLAYER/playerplus/init.lua @@ -122,12 +122,15 @@ minetest.register_globalstep(function(dtime) end -- Apply black sky in the Void and deal Void damage + --[[ DISABLED because of conflicts with weater_pack. + TODO: The sky color handling needs a major rework. 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 < mcl_vars.bedrock_overworld_min - 65 then -- Player is deep into the void, deal void damage if player:get_hp() > 0 then