mirror of
https://github.com/Motschen/Blur.git
synced 2025-12-15 19:25:09 +01:00
Update to 1.21.3
This commit is contained in:
@@ -9,7 +9,7 @@ import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||
|
||||
@Mixin(GameRenderer.class)
|
||||
public class MixinGameRenderer {
|
||||
@ModifyVariable(method = "renderBlur", at = @At("STORE"), ordinal = 1)
|
||||
@ModifyVariable(method = "renderBlur", at = @At("STORE"), ordinal = 0)
|
||||
private float blur$modifyRadius(float radius) { // Modify the radius based on the animation progress
|
||||
if (!BlurInfo.screenChanged && BlurInfo.start >= 0) // Only update the progress after all tests have been completed
|
||||
Blur.updateProgress(BlurInfo.screenHasBlur);
|
||||
|
||||
@@ -18,6 +18,6 @@ public class MixinHandledScreen extends Screen {
|
||||
|
||||
@Inject(method = "renderBackground", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/ingame/HandledScreen;drawBackground(Lnet/minecraft/client/gui/DrawContext;FII)V", shift = At.Shift.BEFORE))
|
||||
private void blur$renderContainerBlur(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) { // Applies the blur effect in containers (Inventory, Chest, etc.)
|
||||
if (BlurConfig.blurContainers) this.applyBlur(delta);
|
||||
if (BlurConfig.blurContainers) this.applyBlur();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public class MixinInGameHud {
|
||||
if (client.currentScreen == null && client.world != null && BlurInfo.start >= 0 && BlurInfo.prevScreenHasBlur) {
|
||||
BlurInfo.doTest = false;
|
||||
BlurInfo.screenChanged = false;
|
||||
this.client.gameRenderer.renderBlur(tickCounter.getTickDelta(true));
|
||||
this.client.gameRenderer.renderBlur();
|
||||
this.client.getFramebuffer().beginWrite(false);
|
||||
|
||||
if (BlurInfo.prevScreenHasBackground) Blur.renderRotatedGradient(context, client.getWindow().getScaledWidth(), client.getWindow().getScaledHeight());
|
||||
|
||||
@@ -32,7 +32,7 @@ public abstract class MixinScreen {
|
||||
}
|
||||
|
||||
if (BlurInfo.start >= 0 && !BlurInfo.screenHasBlur && BlurInfo.prevScreenHasBlur) { // Fade out in non-blurred screens
|
||||
this.client.gameRenderer.renderBlur(delta);
|
||||
this.client.gameRenderer.renderBlur();
|
||||
this.client.getFramebuffer().beginWrite(false);
|
||||
|
||||
if (BlurInfo.prevScreenHasBackground) Blur.renderRotatedGradient(context, width, height);
|
||||
@@ -44,7 +44,7 @@ public abstract class MixinScreen {
|
||||
BlurInfo.screenHasBackground = true; // Test if the screen has a background
|
||||
}
|
||||
@Inject(at = @At("HEAD"), method = "applyBlur", cancellable = true)
|
||||
public void blur$getBlurEnabled(float delta, CallbackInfo ci) {
|
||||
public void blur$getBlurEnabled(CallbackInfo ci) {
|
||||
if (BlurConfig.forceDisabledScreens.contains(this.getClass().getCanonicalName())) {
|
||||
ci.cancel(); return;
|
||||
}
|
||||
@@ -63,7 +63,7 @@ public abstract class MixinScreen {
|
||||
@Inject(at = @At("HEAD"), method = "renderInGameBackground", cancellable = true)
|
||||
public void blur$rotatedGradient(DrawContext context, CallbackInfo ci) {
|
||||
if (BlurConfig.forceEnabledScreens.contains(this.getClass().getCanonicalName()))
|
||||
((ScreenAccessor)this).forceApplyBlur(client.getRenderTickCounter().getTickDelta(true));
|
||||
((ScreenAccessor)this).forceApplyBlur();
|
||||
|
||||
Blur.renderRotatedGradient(context, width, height); // Replaces the default gradient with our rotated one
|
||||
ci.cancel();
|
||||
|
||||
@@ -7,5 +7,5 @@ import org.spongepowered.asm.mixin.gen.Invoker;
|
||||
@Mixin(Screen.class)
|
||||
public interface ScreenAccessor {
|
||||
@Invoker("applyBlur")
|
||||
void forceApplyBlur(float delta);
|
||||
void forceApplyBlur();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user