diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-10-16 18:59:05 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-10-16 18:59:05 +0200 |
commit | 8e6c7e50ad1f02ef369152223a60f670012700e1 (patch) | |
tree | b0df87e6f9bf7f0d0c673249a9efc6f2aa4df4f5 /src/main/java/at/hannibal2 | |
parent | c8b3d52608ff03bf9009fc7b69523b925c9179cb (diff) | |
download | skyhanni-8e6c7e50ad1f02ef369152223a60f670012700e1.tar.gz skyhanni-8e6c7e50ad1f02ef369152223a60f670012700e1.tar.bz2 skyhanni-8e6c7e50ad1f02ef369152223a60f670012700e1.zip |
Fixed bug that prevented some users to start their game.
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/mixins/hooks/MixinPatcherFontRendererHookHook.kt | 19 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinPatcherFontRendererHook.java | 7 |
2 files changed, 21 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/MixinPatcherFontRendererHookHook.kt b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/MixinPatcherFontRendererHookHook.kt new file mode 100644 index 000000000..33ee05271 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/MixinPatcherFontRendererHookHook.kt @@ -0,0 +1,19 @@ +package at.hannibal2.skyhanni.mixins.hooks + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.utils.LorenzUtils +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable + +class MixinPatcherFontRendererHookHook { + companion object { + @JvmStatic + fun overridePatcherFontRenderer(string: String, shadow: Boolean, cir: CallbackInfoReturnable<Boolean>) { + if (!LorenzUtils.onHypixel) return + + if (SkyHanniMod.feature.chroma.enabled) { + cir.cancel() + cir.returnValue = false + } + } + } +}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinPatcherFontRendererHook.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinPatcherFontRendererHook.java index 7c585b725..8cfaebfb2 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinPatcherFontRendererHook.java +++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinPatcherFontRendererHook.java @@ -1,6 +1,6 @@ package at.hannibal2.skyhanni.mixins.transformers; -import at.hannibal2.skyhanni.SkyHanniMod; +import at.hannibal2.skyhanni.mixins.hooks.MixinPatcherFontRendererHookHook; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Pseudo; import org.spongepowered.asm.mixin.injection.At; @@ -13,9 +13,6 @@ public class MixinPatcherFontRendererHook { @Inject(method = "renderStringAtPos(Ljava/lang/String;Z)Z", at = @At("HEAD"), cancellable = true) public void overridePatcherFontRenderer(String string, boolean shadow, CallbackInfoReturnable<Boolean> cir) { - if (SkyHanniMod.getFeature().chroma.enabled) { - cir.cancel(); - cir.setReturnValue(false); - } + MixinPatcherFontRendererHookHook.overridePatcherFontRenderer(string, shadow, cir); } } |