Inventory Blur

This commit is contained in:
kirillsaint 2023-06-30 17:10:09 +06:00
parent afc69f88b0
commit a1a2cf60c9
2 changed files with 32 additions and 1 deletions

View File

@ -0,0 +1,30 @@
package net.silentclient.client.mixin.mixins;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.util.ResourceLocation;
import net.silentclient.client.Client;
import net.silentclient.client.cosmetics.StaticResourceLocation;
import net.silentclient.client.mixin.ducks.EntityRendererExt;
import net.silentclient.client.mods.render.InventoryBlurMod;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(GuiContainer.class)
public class GuiContainerMixin {
@Inject(method = "initGui", at = @At("HEAD"))
public void onOpenBlur(CallbackInfo ci) {
if(Client.getInstance().getModInstances().getModByClass(InventoryBlurMod.class).isEnabled()) {
((EntityRendererExt) Minecraft.getMinecraft().entityRenderer).silent$loadShader(new StaticResourceLocation("shaders/post/menu_blur.json"));
}
}
@Inject(method = "onGuiClosed", at = @At("HEAD"))
public void onCloseBlur(CallbackInfo ci) {
if(Client.getInstance().getModInstances().getModByClass(InventoryBlurMod.class).isEnabled()) {
Minecraft.getMinecraft().entityRenderer.loadEntityShader(null);
}
}
}

View File

@ -39,6 +39,7 @@
"accessors.MinecraftAccessor",
"accessors.ItemFoodAccessor",
"mixins.BlockGlassMixin",
"mixins.ShaderGroupMixin"
"mixins.ShaderGroupMixin",
"mixins.GuiContainerMixin"
]
}