mirror of
https://github.com/Motschen/Blur.git
synced 2025-12-16 11:45:09 +01:00
Blur 2.4.0 - Ingame-Configurable Exclusions & Fixes
- Made Blur exclusions configurable in-game - ReplayMod and ProjectInception screens are excluded by default - Update to MidnightLib 3.0.0 - Fix version in fabric.mod.json
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
package com.tterrag.blur.mixin;
|
||||
|
||||
import com.tterrag.blur.config.BlurConfig;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.font.TextRenderer;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.TextColor;
|
||||
import net.minecraft.util.Formatting;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
@@ -22,24 +26,32 @@ public abstract class MixinScreen {
|
||||
|
||||
@Shadow @Nullable protected MinecraftClient client;
|
||||
|
||||
@Inject(at = @At("HEAD"), method = "render")
|
||||
private void reloadShader(MatrixStack matrixStack, int i, int j, float f, CallbackInfo ci) {
|
||||
if (this.getClass().toString().toLowerCase(Locale.ROOT).contains("midnight") && this.client != null) {
|
||||
@Shadow protected TextRenderer textRenderer;
|
||||
|
||||
@Inject(at = @At("HEAD"), method = "tick")
|
||||
private void blur$reloadShader(CallbackInfo ci) {
|
||||
if (this.getClass().toString().toLowerCase(Locale.ROOT).contains("midnightconfigscreen") && this.client != null) {
|
||||
Blur.INSTANCE.onScreenChange(this.client.currentScreen);
|
||||
}
|
||||
}
|
||||
@Inject(at = @At("TAIL"), method = "render")
|
||||
private void blur$showScreenTitle(MatrixStack matrixStack, int i, int j, float f, CallbackInfo ci) {
|
||||
if (BlurConfig.showScreenTitle && this.client != null && this.client.currentScreen != null) {
|
||||
this.textRenderer.drawWithShadow(matrixStack, this.client.currentScreen.getClass().getName(), 0, 0, 16777215, true);
|
||||
}
|
||||
}
|
||||
|
||||
@ModifyConstant(
|
||||
method = "renderBackground(Lnet/minecraft/client/util/math/MatrixStack;I)V",
|
||||
constant = @Constant(intValue = -1072689136))
|
||||
private int getFirstBackgroundColor(int color) {
|
||||
private int blur$getFirstBackgroundColor(int color) {
|
||||
return Blur.INSTANCE.getBackgroundColor(false);
|
||||
}
|
||||
|
||||
@ModifyConstant(
|
||||
method = "renderBackground(Lnet/minecraft/client/util/math/MatrixStack;I)V",
|
||||
constant = @Constant(intValue = -804253680))
|
||||
private int getSecondBackgroundColor(int color) {
|
||||
private int blur$getSecondBackgroundColor(int color) {
|
||||
return Blur.INSTANCE.getBackgroundColor(true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user