Skip to content

Commit

Permalink
Backport to 1.19.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dima-dencep committed Nov 27, 2023
1 parent 69ca27c commit f2c4c70
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ 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
maven_group=com.github.dima_dencep.mods
archives_base_name=blur-forge

# Dependencies
satin_version=1.20.1+1.15.0-SNAPSHOT
satin_version=1.19.2+1.12.3
7 changes: 1 addition & 6 deletions src/main/java/com/tterrag/blur/Blur.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -38,11 +37,7 @@ public Blur() {
blur.render(event.tickDelta);
}
});
MinecraftForge.EVENT_BUS.<RenderGuiEvent.Post>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.<ScreenEvent.BackgroundRendered>addListener(event -> Blur.screenHasBackground = true);
MinecraftForge.EVENT_BUS.<ScreenEvent.Opening>addListener(event -> {
if (event.getCurrentScreen() != null) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/tterrag/blur/mixin/MixinScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
),
Expand All @@ -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
),
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/mixins.blur.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"package": "com.tterrag.blur.mixin",
"compatibilityLevel": "JAVA_17",
"client": [
"MixinScreen"
"MixinScreen",
"MixinInGameHud"
],
"injectors": {
"defaultRequire": 1
Expand Down

0 comments on commit f2c4c70

Please sign in to comment.