From 19cb044f31ff24c3ada87f2b1027d819be55ee87 Mon Sep 17 00:00:00 2001 From: Muutarg Date: Fri, 21 Feb 2025 22:13:33 +1100 Subject: [PATCH 1/2] fix: Missing rain sounds Fixes bug #628 (no rain particles/sound generated in the overworld), while retaining custom effects when player is on Venus. (To assist Create: Astral modpack) --- .../mixin/client/WorldRendererMixin.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/github/alexnijjar/ad_astra/mixin/client/WorldRendererMixin.java b/src/main/java/com/github/alexnijjar/ad_astra/mixin/client/WorldRendererMixin.java index 944db7b06..5f3a996ff 100644 --- a/src/main/java/com/github/alexnijjar/ad_astra/mixin/client/WorldRendererMixin.java +++ b/src/main/java/com/github/alexnijjar/ad_astra/mixin/client/WorldRendererMixin.java @@ -64,18 +64,22 @@ public void adastra_processWorldEvent(PlayerEntity source, int eventId, BlockPos // Venus rain. @Inject(method = "tickRainSplashing", at = @At("HEAD"), cancellable = true) public void adastra_tickRainSplashing(Camera camera, CallbackInfo info) { - if(!ModUtils.isPlanet(this.client.world)) { - info.cancel(); - } - WorldRendererAccessor worldRenderer = (WorldRendererAccessor) (Object) this; - - - MinecraftClient client = MinecraftClient.getInstance(); RegistryKey world = client.world.getRegistryKey(); + boolean isVenus = false; for (SkyRenderer skyRenderer : AdAstraClient.skyRenderers) { if (world.equals(skyRenderer.dimension()) && skyRenderer.weatherEffects().equals(WeatherEffects.VENUS)) { - + isVenus = true; + break; + } + } + + if (!isVenus) { + return; + } + + WorldRendererAccessor worldRenderer = (WorldRendererAccessor) (Object) this; + float f = client.world.getRainGradient(1.0f) / (MinecraftClient.isFancyGraphicsOrBetter() ? 1.0f : 2.0f); if (f <= 0.0f) { return; @@ -115,10 +119,6 @@ public void adastra_tickRainSplashing(Camera camera, CallbackInfo info) { client.world.playSound((BlockPos) blockPos2, SoundEvents.WEATHER_RAIN, SoundCategory.WEATHER, 0.2f, 1.0f, false); } } - info.cancel(); - break; - } - } - return; + info.cancel(); } } \ No newline at end of file From 26a475971420f6db5b38b25b6de1386c1bb35011 Mon Sep 17 00:00:00 2001 From: Muutarg Date: Sun, 23 Feb 2025 15:47:45 +1100 Subject: [PATCH 2/2] Update changelog.txt --- changelog.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/changelog.txt b/changelog.txt index bc82c2f41..2d900d066 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1 @@ -- fixed guidebook not opening #256 -- fixed broken guis of some of the machine screens due to changed textures -- allow tech reborn and modern industrialization oil to be used in the fuel refinery #258 -- fixed "Secrets Beneath" achievement #257 \ No newline at end of file +- fixed rain sounds not being produced in overworld (#628)