From 71c4b70a4576d5ddb8967ca18127a6f0328a0981 Mon Sep 17 00:00:00 2001 From: NaoCraftLab Date: Sun, 13 Oct 2024 16:21:13 +0400 Subject: [PATCH] Fixed incorrect sky color causing the horizon to be visible through the fog --- CHANGELOG.md | 6 ++++++ docs/presets/custom/SNOWY_VEIL.v2.json | 6 ++---- gradle.properties | 2 +- .../foggypalegarden/mixin/PaleGardenFogMixin.java | 5 +++++ 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a4b04d..75ba1fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.21.2-2.4.1 + +### Fixed + +- Incorrect sky color causing the horizon to be visible through the fog + ## 1.21.2-2.4.0 ### Added diff --git a/docs/presets/custom/SNOWY_VEIL.v2.json b/docs/presets/custom/SNOWY_VEIL.v2.json index 9e067f0..30fc991 100644 --- a/docs/presets/custom/SNOWY_VEIL.v2.json +++ b/docs/presets/custom/SNOWY_VEIL.v2.json @@ -16,8 +16,7 @@ "opacity": 95.0, "encapsulationSpeed": 6.0, "brightness": { - "mode": "BY_GAME_FOG", - "adjustment": 0.5 + "mode": "BY_GAME_FOG" }, "color": { "mode": "BY_GAME_FOG", @@ -39,8 +38,7 @@ "opacity": 100.0, "encapsulationSpeed": 6.0, "brightness": { - "mode": "BY_GAME_FOG", - "adjustment": 0.5 + "mode": "BY_GAME_FOG" }, "color": { "mode": "BY_GAME_FOG", diff --git a/gradle.properties b/gradle.properties index fe7fd9c..da95477 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ org.gradle.parallel=true group=com.naocraftlab modId=foggy-pale-garden modCurseForgeId=1114471 -modVersion=2.4.0 +modVersion=2.4.1 modName=Foggy Pale Garden modDescription=Adds dense fog to the Pale Garden biome. modLicense=MIT diff --git a/src/main/java/com/naocraftlab/foggypalegarden/mixin/PaleGardenFogMixin.java b/src/main/java/com/naocraftlab/foggypalegarden/mixin/PaleGardenFogMixin.java index fef14c0..df44538 100644 --- a/src/main/java/com/naocraftlab/foggypalegarden/mixin/PaleGardenFogMixin.java +++ b/src/main/java/com/naocraftlab/foggypalegarden/mixin/PaleGardenFogMixin.java @@ -90,6 +90,11 @@ private static void injectApplyFog( assert fogCharacteristics.color().alpha() >= 0.0f : "FPG: Alpha color component is negative"; assert fogCharacteristics.color().alpha() <= 1.0f : "FPG: Alpha color component is greater than 1.0"; + color.x = color.x * (1.0f - fogDensity) + fogCharacteristics.color().red() * fogDensity; + color.y = color.y * (1.0f - fogDensity) + fogCharacteristics.color().green() * fogDensity; + color.z = color.z * (1.0f - fogDensity) + fogCharacteristics.color().blue() * fogDensity; + color.w = color.w * (1.0f - fogDensity) + fogCharacteristics.color().alpha() * fogDensity; + cir.setReturnValue(fogOf(fogCharacteristics)); cir.cancel(); }