diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinWeatherRendering.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinWeatherRendering.java index 033053c4..9b399e6f 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinWeatherRendering.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinWeatherRendering.java @@ -27,11 +27,21 @@ import net.minecraft.world.biome.Biome; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(WeatherRendering.class) public abstract class MixinWeatherRendering { + @Redirect(method = "renderPrecipitation(Lnet/minecraft/world/World;Lnet/minecraft/client/render/LightmapTextureManager;IFLnet/minecraft/util/math/Vec3d;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;getRainGradient(F)F")) + private float forceSnow(World instance, float delta) { + if (CPEAdditions.isSnowing()) { + return 1F; + } else { + return instance.getRainGradient(delta); + } + } + @Inject(method = "getPrecipitationAt", at = @At(value = "HEAD"), cancellable = true) private void forceSnow(World world, BlockPos pos, CallbackInfoReturnable cir) { if (CPEAdditions.isSnowing()) {