mirror of
https://github.com/refactorinqq/SLC-1.8.9.git
synced 2024-11-10 08:11:31 +01:00
Fixed Menu Blur
This commit is contained in:
parent
881f793520
commit
0b95f422f8
@ -201,9 +201,9 @@ public final class ConfigManager {
|
|||||||
if(set.getName() == "Menu Background Blur") {
|
if(set.getName() == "Menu Background Blur") {
|
||||||
if(Minecraft.getMinecraft().currentScreen != null) {
|
if(Minecraft.getMinecraft().currentScreen != null) {
|
||||||
if(!set.getValBoolean()) {
|
if(!set.getValBoolean()) {
|
||||||
Minecraft.getMinecraft().entityRenderer.loadEntityShader(null);
|
MenuBlurUtils.unloadBlur(true);
|
||||||
} else {
|
} else {
|
||||||
MenuBlurUtils.loadBlur();
|
MenuBlurUtils.loadBlur(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@ package net.silentclient.client.mixin.mixins;
|
|||||||
|
|
||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraft.util.StringUtils;
|
import net.minecraft.util.StringUtils;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.silentclient.client.Client;
|
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.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
@Mixin(value = AbstractClientPlayer.class, priority = 2000)
|
@Mixin(AbstractClientPlayer.class)
|
||||||
public abstract class AbstractClientPlayerMixin implements AbstractClientPlayerExt {
|
public abstract class AbstractClientPlayerMixin implements AbstractClientPlayerExt {
|
||||||
@Unique private AnimatedResourceLocation silent$cape;
|
@Unique private AnimatedResourceLocation silent$cape;
|
||||||
@Unique private AnimatedResourceLocation silent$bandana;
|
@Unique private AnimatedResourceLocation silent$bandana;
|
||||||
|
@ -53,9 +53,9 @@ public class GeneralMod extends Mod {
|
|||||||
break;
|
break;
|
||||||
case "Menu Background Blur":
|
case "Menu Background Blur":
|
||||||
if(setting.getValBoolean()) {
|
if(setting.getValBoolean()) {
|
||||||
MenuBlurUtils.loadBlur();
|
MenuBlurUtils.loadBlur(true);
|
||||||
} else {
|
} else {
|
||||||
MenuBlurUtils.unloadBlur();
|
MenuBlurUtils.unloadBlur(true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "Menu Animations":
|
case "Menu Animations":
|
||||||
|
@ -8,13 +8,21 @@ import net.silentclient.client.mods.settings.GeneralMod;
|
|||||||
|
|
||||||
public class MenuBlurUtils {
|
public class MenuBlurUtils {
|
||||||
public static void loadBlur() {
|
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"));
|
((EntityRendererExt) Minecraft.getMinecraft().entityRenderer).silent$loadShader(new StaticResourceLocation("shaders/post/menu_blur.json"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void unloadBlur() {
|
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);
|
Minecraft.getMinecraft().entityRenderer.loadEntityShader(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user