From ef97091bb14368a9d4d2216fa268e49b5d1ce0ac Mon Sep 17 00:00:00 2001 From: kirillsaint Date: Sat, 30 Sep 2023 15:39:18 +0600 Subject: [PATCH] Update FontRendererMixin.java --- .../client/mixin/mixins/FontRendererMixin.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/net/silentclient/client/mixin/mixins/FontRendererMixin.java b/src/main/java/net/silentclient/client/mixin/mixins/FontRendererMixin.java index 36a401e..6108d97 100644 --- a/src/main/java/net/silentclient/client/mixin/mixins/FontRendererMixin.java +++ b/src/main/java/net/silentclient/client/mixin/mixins/FontRendererMixin.java @@ -9,7 +9,9 @@ import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.ModifyVariable; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(value = FontRenderer.class, priority = 1100) public abstract class FontRendererMixin implements FontRendererExt { @@ -46,4 +48,14 @@ public abstract class FontRendererMixin implements FontRendererExt { protected abstract void resetStyles(); @Shadow @Final private ResourceLocation locationFontTexture; + + @Inject(method = "drawString(Ljava/lang/String;FFIZ)I", + at = @At( + value = "INVOKE", target = "Lnet/minecraft/client/gui/FontRenderer;renderString(Ljava/lang/String;FFIZ)I", + ordinal = 0, shift = At.Shift.AFTER + ) + ) + private void silent$resetStyle(CallbackInfoReturnable ci) { + this.resetStyles(); + } }