From 07ef4c86d07fa7105f9c20668264f16145fb074a Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 19 Mar 2023 19:47:43 +0100 Subject: Removed unnecessary removeColor calls --- src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/main/java/at') diff --git a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt index 480be51d8..e7aa2b475 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt @@ -3,7 +3,6 @@ package at.hannibal2.skyhanni.utils import at.hannibal2.skyhanni.config.core.config.Position import at.hannibal2.skyhanni.config.core.util.render.TextRenderUtils.drawStringScaled import at.hannibal2.skyhanni.utils.NEUItems.renderOnScreen -import at.hannibal2.skyhanni.utils.StringUtils.removeColor import net.minecraft.client.Minecraft import net.minecraft.client.gui.FontRenderer import net.minecraft.client.gui.Gui @@ -441,7 +440,7 @@ object RenderUtils { val renderer = minecraft.renderManager.fontRenderer ?: return val offsetX = if (center) { - (200 - renderer.getStringWidth(display.removeColor())) / 2 + (200 - renderer.getStringWidth(display)) / 2 } else { 0 } + extraOffsetX @@ -512,7 +511,7 @@ object RenderUtils { } if (any is String) { renderString(any, offsetX, offsetY, center = false) - val width = renderer.getStringWidth(any.removeColor()) + val width = renderer.getStringWidth(any) offsetX += width } else if (any is ItemStack) { val isX = getAbsX(resolution, 200) + offsetX @@ -723,7 +722,7 @@ object RenderUtils { GlStateManager.rotate(-renderManager.playerViewY, 0.0f, 1.0f, 0.0f) GlStateManager.rotate(renderManager.playerViewX, 1.0f, 0.0f, 0.0f) GlStateManager.scale(-scale / 25, -scale / 25, scale / 25) - val stringWidth = fontRenderer.getStringWidth(text.removeColor()) + val stringWidth = fontRenderer.getStringWidth(text) if (shadow) { fontRenderer.drawStringWithShadow( text, -- cgit