diff options
author | inglettronald <inglettronald@gmail.com> | 2023-06-30 23:53:15 -0500 |
---|---|---|
committer | inglettronald <inglettronald@gmail.com> | 2023-06-30 23:53:15 -0500 |
commit | b47a1f596e85358a834f0dc105010be79cd5b2c2 (patch) | |
tree | 2e5d6a53fc643329d6126fe41bf204307c32bba4 /src/main/java/com | |
parent | c43cbe3c2883a60e00533c5f32449f4a35f308b5 (diff) | |
download | DulkirMod-Fabric-b47a1f596e85358a834f0dc105010be79cd5b2c2.tar.gz DulkirMod-Fabric-b47a1f596e85358a834f0dc105010be79cd5b2c2.tar.bz2 DulkirMod-Fabric-b47a1f596e85358a834f0dc105010be79cd5b2c2.zip |
Option added to hide Status Effects
Diffstat (limited to 'src/main/java/com')
-rw-r--r-- | src/main/java/com/dulkirfabric/mixin/render/AbstractInventoryScreenMixin.java | 20 | ||||
-rw-r--r-- | src/main/java/com/dulkirfabric/mixin/render/InGameHudMixin.java | 20 |
2 files changed, 40 insertions, 0 deletions
diff --git a/src/main/java/com/dulkirfabric/mixin/render/AbstractInventoryScreenMixin.java b/src/main/java/com/dulkirfabric/mixin/render/AbstractInventoryScreenMixin.java new file mode 100644 index 0000000..fd32af7 --- /dev/null +++ b/src/main/java/com/dulkirfabric/mixin/render/AbstractInventoryScreenMixin.java @@ -0,0 +1,20 @@ +package com.dulkirfabric.mixin.render; + +import com.dulkirfabric.config.DulkirConfig; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.gui.screen.ingame.AbstractInventoryScreen; +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(AbstractInventoryScreen.class) +public class AbstractInventoryScreenMixin { + + @Inject(method = "drawStatusEffects", at = @At("HEAD"), cancellable = true) + public void onDrawStatusEffects(DrawContext context, int mouseX, int mouseY, CallbackInfo ci) { + if (DulkirConfig.ConfigVars.getConfigOptions().getStatusEffectHidden()) { + ci.cancel(); + } + } +} diff --git a/src/main/java/com/dulkirfabric/mixin/render/InGameHudMixin.java b/src/main/java/com/dulkirfabric/mixin/render/InGameHudMixin.java new file mode 100644 index 0000000..cd45aed --- /dev/null +++ b/src/main/java/com/dulkirfabric/mixin/render/InGameHudMixin.java @@ -0,0 +1,20 @@ +package com.dulkirfabric.mixin.render; + +import com.dulkirfabric.config.DulkirConfig; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.gui.hud.InGameHud; +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(InGameHud.class) +public class InGameHudMixin { + + @Inject(method = "renderStatusEffectOverlay", at = @At("HEAD"), cancellable = true) + public void onRenderStatusEffectOverlay(DrawContext context, CallbackInfo ci) { + if (DulkirConfig.ConfigVars.getConfigOptions().getStatusEffectHidden()) { + ci.cancel(); + } + } +} |