From f4c9bc1161bbd154a664c763c57a4ddd2048391e Mon Sep 17 00:00:00 2001 From: RacoonDog <32882447+RacoonDog@users.noreply.github.com> Date: Thu, 22 Dec 2022 22:49:03 -0500 Subject: [PATCH] fix player head rendering --- .../meteorclient/mixin/ChatHudMixin.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/ChatHudMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/ChatHudMixin.java index 98e15f55e2..5e91d136ee 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/ChatHudMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/ChatHudMixin.java @@ -27,6 +27,7 @@ import net.minecraft.network.message.MessageSignatureData; import net.minecraft.text.Text; import net.minecraft.util.Identifier; +import net.minecraft.util.math.MathHelper; import org.jetbrains.annotations.Nullable; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; @@ -111,8 +112,12 @@ private void onRender(MatrixStack matrices, int currentTick, int mouseX, int mou double g = 9.0D * (mc.options.getChatLineSpacing().getValue() + 1.0D); double h = -8.0D * (mc.options.getChatLineSpacing().getValue() + 1.0D) + 4.0D * mc.options.getChatLineSpacing().getValue() + 8.0D; + float chatScale = (float) this.getChatScale(); + float scaledHeight = mc.getWindow().getScaledHeight(); + matrices.push(); - matrices.translate(2, -0.1f, 10); + matrices.scale(chatScale, chatScale, 1.0f); + matrices.translate(2.0f, MathHelper.floor((scaledHeight - 40) / chatScale) - g - 0.1f, 10.0f); RenderSystem.enableBlend(); for(int m = 0; m + this.scrolledLines < this.visibleMessages.size() && m < maxLineCount; ++m) { ChatHudLine.Visible chatHudLine = this.visibleMessages.get(m + this.scrolledLines); @@ -153,6 +158,9 @@ private static double getMessageOpacityMultiplier(int age) { @Final private List messages; + @Shadow + public abstract double getChatScale(); + private void drawIcon(MatrixStack matrices, String line, int y, float opacity) { if (METEOR_PREFIX_REGEX.matcher(line).find()) { RenderSystem.setShaderTexture(0, METEOR_CHAT_ICON);