aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorLorenz <ESs95s3P5z8Pheb>2022-07-14 10:05:23 +0200
committerLorenz <ESs95s3P5z8Pheb>2022-07-14 10:05:23 +0200
commit5f5d82bd914a05e69e7b9dc14808156aebfa0ee9 (patch)
treea79d284933b7d005b407ecb12a3f5e41873b64a7 /src/main/java/at
parent00fc1b55b6ebbcd19fa4d17df2fbeb50669d501b (diff)
downloadskyhanni-5f5d82bd914a05e69e7b9dc14808156aebfa0ee9.tar.gz
skyhanni-5f5d82bd914a05e69e7b9dc14808156aebfa0ee9.tar.bz2
skyhanni-5f5d82bd914a05e69e7b9dc14808156aebfa0ee9.zip
default text render is white now
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/lorenz/mod/utils/GuiRender.kt6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/at/lorenz/mod/utils/GuiRender.kt b/src/main/java/at/lorenz/mod/utils/GuiRender.kt
index 87c14df4a..f32b9bdf2 100644
--- a/src/main/java/at/lorenz/mod/utils/GuiRender.kt
+++ b/src/main/java/at/lorenz/mod/utils/GuiRender.kt
@@ -1,5 +1,6 @@
package at.lorenz.mod.utils
+import at.lorenz.mod.utils.LorenzUtils.removeColorCodes
import com.thatgravyboat.skyblockhud_2.core.config.Position
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.ScaledResolution
@@ -8,13 +9,14 @@ import net.minecraft.client.renderer.GlStateManager
object GuiRender {
fun Position.renderString(string: String) {
+ val textToRender = "§f$string"
GlStateManager.pushMatrix()
val resolution = ScaledResolution(Minecraft.getMinecraft())
val renderer = Minecraft.getMinecraft().renderManager.fontRenderer
- val offsetX = (200 - renderer.getStringWidth(string)) / 2
+ val offsetX = (200 - renderer.getStringWidth(textToRender.removeColorCodes())) / 2
val x = getAbsX(resolution, 200) + offsetX
val y = getAbsY(resolution, 16)
@@ -22,7 +24,7 @@ object GuiRender {
GlStateManager.translate(x + 1.0, y + 1.0, 0.0)
- renderer.drawStringWithShadow(string, 0f, 0f, 0)
+ renderer.drawStringWithShadow(textToRender, 0f, 0f, 0)
GlStateManager.popMatrix()