diff --git a/src/main/java/net/silentclient/client/config/ConfigManager.java b/src/main/java/net/silentclient/client/config/ConfigManager.java index d1908c5..e4c1683 100644 --- a/src/main/java/net/silentclient/client/config/ConfigManager.java +++ b/src/main/java/net/silentclient/client/config/ConfigManager.java @@ -201,10 +201,10 @@ public final class ConfigManager { if(set.getName() == "Menu Background Blur") { if(Minecraft.getMinecraft().currentScreen != null) { if(!set.getValBoolean()) { - Minecraft.getMinecraft().entityRenderer.loadEntityShader(null); - } else { - MenuBlurUtils.loadBlur(); - } + MenuBlurUtils.unloadBlur(true); + } else { + MenuBlurUtils.loadBlur(true); + } } } } catch (Exception err) { diff --git a/src/main/java/net/silentclient/client/mixin/mixins/AbstractClientPlayerMixin.java b/src/main/java/net/silentclient/client/mixin/mixins/AbstractClientPlayerMixin.java index f155a49..fe198d6 100644 --- a/src/main/java/net/silentclient/client/mixin/mixins/AbstractClientPlayerMixin.java +++ b/src/main/java/net/silentclient/client/mixin/mixins/AbstractClientPlayerMixin.java @@ -2,7 +2,6 @@ package net.silentclient.client.mixin.mixins; import com.mojang.authlib.GameProfile; import net.minecraft.client.entity.AbstractClientPlayer; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.StringUtils; import net.minecraft.world.World; import net.silentclient.client.Client; @@ -18,7 +17,7 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -@Mixin(value = AbstractClientPlayer.class, priority = 2000) +@Mixin(AbstractClientPlayer.class) public abstract class AbstractClientPlayerMixin implements AbstractClientPlayerExt { @Unique private AnimatedResourceLocation silent$cape; @Unique private AnimatedResourceLocation silent$bandana; diff --git a/src/main/java/net/silentclient/client/mods/settings/GeneralMod.java b/src/main/java/net/silentclient/client/mods/settings/GeneralMod.java index a2e2b08..f647cdb 100644 --- a/src/main/java/net/silentclient/client/mods/settings/GeneralMod.java +++ b/src/main/java/net/silentclient/client/mods/settings/GeneralMod.java @@ -53,9 +53,9 @@ public class GeneralMod extends Mod { break; case "Menu Background Blur": if(setting.getValBoolean()) { - MenuBlurUtils.loadBlur(); + MenuBlurUtils.loadBlur(true); } else { - MenuBlurUtils.unloadBlur(); + MenuBlurUtils.unloadBlur(true); } break; case "Menu Animations": diff --git a/src/main/java/net/silentclient/client/utils/MenuBlurUtils.java b/src/main/java/net/silentclient/client/utils/MenuBlurUtils.java index 7b5f18c..d798fb3 100644 --- a/src/main/java/net/silentclient/client/utils/MenuBlurUtils.java +++ b/src/main/java/net/silentclient/client/utils/MenuBlurUtils.java @@ -8,13 +8,21 @@ import net.silentclient.client.mods.settings.GeneralMod; public class MenuBlurUtils { public static void loadBlur() { - if(Client.getInstance().getSettingsManager().getSettingByClass(GeneralMod.class, "Menu Background Blur").getValBoolean()) { + loadBlur(false); + } + + public static void loadBlur(boolean force) { + if(Client.getInstance().getSettingsManager().getSettingByClass(GeneralMod.class, "Menu Background Blur").getValBoolean() || force) { ((EntityRendererExt) Minecraft.getMinecraft().entityRenderer).silent$loadShader(new StaticResourceLocation("shaders/post/menu_blur.json")); } } public static void unloadBlur() { - if(Client.getInstance().getSettingsManager().getSettingByClass(GeneralMod.class, "Menu Background Blur").getValBoolean()) { + unloadBlur(false); + } + + public static void unloadBlur(boolean force) { + if(Client.getInstance().getSettingsManager().getSettingByClass(GeneralMod.class, "Menu Background Blur").getValBoolean() || force) { Minecraft.getMinecraft().entityRenderer.loadEntityShader(null); } }