diff options
author | Lorenz <lo.scherf@gmail.com> | 2022-08-15 12:01:02 +0200 |
---|---|---|
committer | Lorenz <lo.scherf@gmail.com> | 2022-08-15 12:01:02 +0200 |
commit | 6fbbcb5a7ce630646ca374d811e480e7719a2641 (patch) | |
tree | 7a6ba30860bcaef108a432373142f386c1908260 /src/main/java/at/hannibal2/skyhanni/utils | |
parent | 263f80c3ecb6896de74668b4833a2b5c154bf463 (diff) | |
download | skyhanni-6fbbcb5a7ce630646ca374d811e480e7719a2641.tar.gz skyhanni-6fbbcb5a7ce630646ca374d811e480e7719a2641.tar.bz2 skyhanni-6fbbcb5a7ce630646ca374d811e480e7719a2641.zip |
code cleanup
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt index 430c45777..63eff42f5 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt @@ -324,26 +324,25 @@ object RenderUtils { fun drawLabel( pos: Vec3, text: String, - color: Color, partialTicks: Float, shadow: Boolean = false, scale: Float = 1f, yOff: Float = 0f, ) { - var mc = Minecraft.getMinecraft() - val player = mc.thePlayer + val minecraft = Minecraft.getMinecraft() + val player = minecraft.thePlayer val x = pos.xCoord - player.lastTickPosX + (pos.xCoord - player.posX - (pos.xCoord - player.lastTickPosX)) * partialTicks val y = pos.yCoord - player.lastTickPosY + (pos.yCoord - player.posY - (pos.yCoord - player.lastTickPosY)) * partialTicks val z = pos.zCoord - player.lastTickPosZ + (pos.zCoord - player.posZ - (pos.zCoord - player.lastTickPosZ)) * partialTicks - val renderManager = mc.renderManager val f1 = 0.0266666688 - val width = mc.fontRendererObj.getStringWidth(text) / 2 + val width = minecraft.fontRendererObj.getStringWidth(text) / 2 GlStateManager.pushMatrix() GlStateManager.translate(x, y, z) GL11.glNormal3f(0f, 1f, 0f) + val renderManager = minecraft.renderManager GlStateManager.rotate(-renderManager.playerViewY, 0f, 1f, 0f) GlStateManager.rotate(renderManager.playerViewX, 1f, 0f, 0f) GlStateManager.scale(-f1, -f1, -f1) @@ -352,7 +351,7 @@ object RenderUtils { GlStateManager.disableLighting() GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0) GlStateManager.enableTexture2D() - mc.fontRendererObj.drawString(text, (-width).toFloat(), yOff, color.rgb, shadow) + minecraft.fontRendererObj.drawString(text, (-width).toFloat(), yOff, LorenzColor.WHITE.toColor().rgb, shadow) GlStateManager.disableBlend() GlStateManager.popMatrix() } |