Skip to content

Commit bd3b58a

Browse files
committed
Blur 3.1.1 - 1.20.2 & New excluded screens
- Port to 1.20.2 by @TheMrEngMan & @backryun - Exclude MidnightControls' touchscreen overlay and Baritone click screen by default (closes #75) - Miscellaneous fixes
1 parent d8b6a14 commit bd3b58a

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

src/main/java/com/tterrag/blur/Blur.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void onInitializeClient() {
4141

4242
public static void onScreenChange(Screen newGui) {
4343
if (client.world != null) {
44-
boolean excluded = newGui == null || BlurConfig.blurExclusions.stream().anyMatch(exclusion -> newGui.getClass().getName().contains(exclusion));
44+
boolean excluded = newGui == null || BlurConfig.blurExclusions.stream().anyMatch(exclusion -> newGui.getClass().getName().startsWith(exclusion));
4545
if (!excluded) {
4646
screenHasBackground = false;
4747
if (BlurConfig.showScreenTitle) System.out.println(newGui.getClass().getName());

src/main/java/com/tterrag/blur/config/BlurConfig.java

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,34 @@
77
import java.util.List;
88

99
public class BlurConfig extends MidnightConfig {
10-
public static final String style = "style";
11-
public static final String screens = "screens";
10+
public static final String STYLE = "style";
11+
public static final String SCREENS = "screens";
1212

13-
14-
@Entry(category = screens)
13+
@Entry(category = SCREENS)
1514
public static List<String> blurExclusions = Lists.newArrayList(ChatScreen.class.getName(),
1615
"com.replaymod.lib.de.johni0702.minecraft.gui.container.AbstractGuiOverlay$UserInputGuiScreen",
1716
"ai.arcblroth.projectInception.client.InceptionInterfaceScreen",
1817
"net.optifine.gui.GuiChatOF",
18+
"baritone.",
1919
"io.github.darkkronicle.advancedchatcore.chat.AdvancedChatScreen",
20-
"net.coderbot.iris.gui.screen.ShaderPackScreen");
21-
@Entry(category = style, min = 0, max = 5000, width = 4)
20+
"net.coderbot.iris.gui.screen.ShaderPackScreen",
21+
"eu.midnightdust.midnightcontrols.client.gui.TouchscreenOverlay");
22+
@Entry(category = STYLE, min = 0, max = 5000, width = 4)
2223
public static int fadeTimeMillis = 200;
23-
@Entry(category = style, min = 0, max = 5000, width = 4)
24+
@Entry(category = STYLE, min = 0, max = 5000, width = 4)
2425
public static int fadeOutTimeMillis = 200;
25-
@Entry(category = style)
26+
@Entry(category = STYLE)
2627
public static boolean ease = true;
27-
@Entry(category = style, isSlider = true, min = 0, max = 100)
28+
@Entry(category = STYLE, isSlider = true, min = 0, max = 100)
2829
public static int radius = 8;
29-
@Entry(category = style, isColor = true, width = 7, min = 7)
30+
@Entry(category = STYLE, isColor = true, width = 7, min = 7)
3031
public static String gradientStart = "#000000";
31-
@Entry(category = style, isSlider = true, min = 0, max = 255)
32+
@Entry(category = STYLE, isSlider = true, min = 0, max = 255)
3233
public static int gradientStartAlpha = 75;
33-
@Entry(category = style, isColor = true, width = 7, min = 7)
34+
@Entry(category = STYLE, isColor = true, width = 7, min = 7)
3435
public static String gradientEnd = "#000000";
35-
@Entry(category = style, isSlider = true, min = 0, max = 255)
36+
@Entry(category = STYLE, isSlider = true, min = 0, max = 255)
3637
public static int gradientEndAlpha = 75;
37-
@Entry(category = screens)
38+
@Entry(category = SCREENS)
3839
public static boolean showScreenTitle = false;
3940
}

src/main/java/com/tterrag/blur/mixin/MixinInGameHud.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.tterrag.blur.mixin;
22

3-
import com.mojang.blaze3d.systems.RenderSystem;
43
import com.tterrag.blur.Blur;
54
import com.tterrag.blur.config.BlurConfig;
65
import net.minecraft.client.MinecraftClient;
@@ -20,7 +19,7 @@ public class MixinInGameHud {
2019
@Final @Shadow private MinecraftClient client;
2120
@Inject(at = @At("TAIL"), method = "render")
2221
public void blur$onRender(DrawContext context, float tickDelta, CallbackInfo ci) {
23-
if (client.currentScreen == null && client.world != null && Blur.start > 0 && !BlurConfig.blurExclusions.contains(Blur.prevScreen) && Blur.screenHasBackground) {
22+
if (client.currentScreen == null && client.world != null && Blur.start > 0 && BlurConfig.blurExclusions.stream().noneMatch(exclusion -> Blur.prevScreen.startsWith(exclusion)) && Blur.screenHasBackground) {
2423
context.fillGradient(0, 0, this.scaledWidth, this.scaledHeight, Blur.getBackgroundColor(false, false), Blur.getBackgroundColor(true, false));
2524
}
2625
}

0 commit comments

Comments
 (0)