From 6d609be8c7aad22643b00853d176d97b1a216287 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 24 Nov 2017 04:00:30 +0100 Subject: [PATCH] Instant rain sound updates when changing dimension --- mods/ENVIRONMENT/mcl_weather/rain.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mods/ENVIRONMENT/mcl_weather/rain.lua b/mods/ENVIRONMENT/mcl_weather/rain.lua index 7f9109af6..3ad407702 100644 --- a/mods/ENVIRONMENT/mcl_weather/rain.lua +++ b/mods/ENVIRONMENT/mcl_weather/rain.lua @@ -102,6 +102,18 @@ mcl_weather.rain.remove_player = function(player) end end +mcl_worlds.register_on_dimension_change(function(player, dimension) + if dimension ~= "overworld" and dimension ~= "void" then + mcl_weather.rain.remove_sound(player) + mcl_weather.rain.remove_player(player) + elseif dimension == "overworld" then + mcl_weather.rain.update_sound(player) + if mcl_weather.rain.raining then + mcl_weather.rain.add_player(player) + end + end +end) + -- adds and removes rain sound depending how much rain particles around player currently exist. -- have few seconds delay before each check to avoid on/off sound too often -- when player stay on 'edge' where sound should play and stop depending from random raindrop appearance.