From 7b3e9983c3176d6421418e69e9be6084a42de9c7 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sat, 17 Feb 2024 20:14:13 +0100 Subject: [PATCH] fix: incompatibility with invmove --- CHANGELOG.md | 3 ++- .../support/tooltip/SmallTextClientTooltipComponent.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 83ee18f31..512faf781 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Added -- Ported to Minecraft 1.20.4. +- Ported to Minecraft 1.20.4. - Custom disk models. Fluid disks now have a different model. - Portable Grid @@ -21,6 +21,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Fixed - Fixed bug where Grid contents weren't synced properly when a network merge occurs. +- Fixed incompatibility crash with InvMove on Fabric. ## [2.0.0-milestone.3.2] - 2023-11-03 diff --git a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/SmallTextClientTooltipComponent.java b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/SmallTextClientTooltipComponent.java index 4de87fadf..87465252e 100644 --- a/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/SmallTextClientTooltipComponent.java +++ b/refinedstorage2-platform-common/src/main/java/com/refinedmods/refinedstorage2/platform/common/support/tooltip/SmallTextClientTooltipComponent.java @@ -8,11 +8,9 @@ public class SmallTextClientTooltipComponent implements ClientTooltipComponent { private final Component text; - private final float scale; public SmallTextClientTooltipComponent(final Component text) { this.text = text; - this.scale = SmallText.getScale(); } @Override @@ -21,6 +19,7 @@ public void renderText(final Font font, final int y, final Matrix4f pose, final MultiBufferSource.BufferSource buffer) { + final float scale = SmallText.getScale(); SmallText.render(font, text.getVisualOrderText(), x, y, scale, pose, buffer); } @@ -31,6 +30,7 @@ public int getHeight() { @Override public int getWidth(final Font font) { + final float scale = SmallText.getScale(); return (int) (font.width(text) * scale); } }