From f2c4c70d88e72c7ae1a5eb57cbc3575d91849451 Mon Sep 17 00:00:00 2001 From: dima_dencep Date: Mon, 27 Nov 2023 23:33:47 +0700 Subject: [PATCH] Backport to 1.19.2 --- gradle.properties | 8 ++++---- src/main/java/com/tterrag/blur/Blur.java | 7 +------ src/main/java/com/tterrag/blur/mixin/MixinScreen.java | 4 ++-- src/main/resources/mixins.blur.json | 3 ++- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/gradle.properties b/gradle.properties index e70785f..f5e4d11 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,9 +6,9 @@ loom.platform=forge # Fabric Properties # check these on https://fabricmc.net/develop - minecraft_version=1.20.1 - yarn_mappings=1.20.1+build.10 - loader_version=1.20.1-47.1.3 + minecraft_version=1.19.2 + yarn_mappings=1.19.2+build.28 + loader_version=1.19.2-43.3.0 # Mod Properties mod_version=3.1.1 @@ -16,4 +16,4 @@ loom.platform=forge archives_base_name=blur-forge # Dependencies - satin_version=1.20.1+1.15.0-SNAPSHOT + satin_version=1.19.2+1.12.3 diff --git a/src/main/java/com/tterrag/blur/Blur.java b/src/main/java/com/tterrag/blur/Blur.java index ace2564..79aed1e 100644 --- a/src/main/java/com/tterrag/blur/Blur.java +++ b/src/main/java/com/tterrag/blur/Blur.java @@ -8,7 +8,6 @@ import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.Screen; import net.minecraft.util.Identifier; -import net.minecraftforge.client.event.RenderGuiEvent; import net.minecraftforge.client.event.ScreenEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.Mod; @@ -38,11 +37,7 @@ public Blur() { blur.render(event.tickDelta); } }); - MinecraftForge.EVENT_BUS.addListener(event -> { - if (client.currentScreen == null && client.world != null && Blur.start > 0 && BlurConfig.INSTANCE.blurExclusions.get().stream().noneMatch(exclusion -> Blur.prevScreen.startsWith(exclusion)) && Blur.screenHasBackground) { - event.getGuiGraphics().fillGradient(0, 0, event.getWindow().getScaledWidth(), event.getWindow().getScaledHeight(), Blur.getBackgroundColor(false, false), Blur.getBackgroundColor(true, false)); - } - }); + MinecraftForge.EVENT_BUS.addListener(event -> Blur.screenHasBackground = true); MinecraftForge.EVENT_BUS.addListener(event -> { if (event.getCurrentScreen() != null) { diff --git a/src/main/java/com/tterrag/blur/mixin/MixinScreen.java b/src/main/java/com/tterrag/blur/mixin/MixinScreen.java index 3dba1e1..d78e4d4 100755 --- a/src/main/java/com/tterrag/blur/mixin/MixinScreen.java +++ b/src/main/java/com/tterrag/blur/mixin/MixinScreen.java @@ -11,7 +11,7 @@ @Mixin(Screen.class) public abstract class MixinScreen { @ModifyConstant( - method = "renderBackground", + method = "renderBackground(Lnet/minecraft/client/util/math/MatrixStack;I)V", constant = @Constant( intValue = -1072689136 ), @@ -22,7 +22,7 @@ public abstract class MixinScreen { } @ModifyConstant( - method = "renderBackground", + method = "renderBackground(Lnet/minecraft/client/util/math/MatrixStack;I)V", constant = @Constant( intValue = -804253680 ), diff --git a/src/main/resources/mixins.blur.json b/src/main/resources/mixins.blur.json index d991939..695292a 100644 --- a/src/main/resources/mixins.blur.json +++ b/src/main/resources/mixins.blur.json @@ -4,7 +4,8 @@ "package": "com.tterrag.blur.mixin", "compatibilityLevel": "JAVA_17", "client": [ - "MixinScreen" + "MixinScreen", + "MixinInGameHud" ], "injectors": { "defaultRequire": 1