fix: container blur not working on NeoForge

This commit is contained in:
Martin Prokoph
2025-01-14 11:50:04 +01:00
parent a13cdd11a7
commit e5c2a542f4
4 changed files with 27 additions and 15 deletions

View File

@@ -26,18 +26,7 @@ public abstract class MixinScreen {
@Inject(at = @At("HEAD"), method = "render")
public void blur$processScreenChange(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
if (!BlurInfo.doTest && BlurInfo.screenChanged) { // After the tests for blur and background color have been completed
Blur.onScreenChange();
BlurInfo.screenChanged = false;
}
if (BlurInfo.start >= 0 && !BlurInfo.screenHasBlur && BlurInfo.prevScreenHasBlur) { // Fade out in non-blurred screens
this.client.gameRenderer.renderBlur();
this.client.getFramebuffer().beginWrite(false);
if (BlurInfo.prevScreenHasBackground) Blur.renderRotatedGradient(context, width, height);
}
BlurInfo.doTest = false; // Set the test state to completed, as tests will happen in the same tick.
Blur.onRender(context, width, height, this.client);
}
@Inject(at = @At("HEAD"), method = "renderInGameBackground")
public void blur$getBackgroundEnabled(DrawContext context, CallbackInfo ci) {