aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt b/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt
index ee699b161..a8ecdfc52 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt
@@ -7,6 +7,7 @@ import at.hannibal2.skyhanni.events.RenderItemTipEvent
import at.hannibal2.skyhanni.mixins.transformers.gui.AccessorGuiContainer
import at.hannibal2.skyhanni.utils.InventoryUtils.getInventoryName
import at.hannibal2.skyhanni.utils.LorenzUtils
+import at.hannibal2.skyhanni.utils.RenderUtils
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.inventory.GuiChest
import net.minecraft.client.renderer.GlStateManager
@@ -26,20 +27,13 @@ class ItemTipHelper {
if (itemTipEvent.renderObjects.isEmpty()) return
- GlStateManager.disableLighting()
- GlStateManager.disableDepth()
- GlStateManager.disableBlend()
-
for (renderObject in itemTipEvent.renderObjects) {
- val fontRenderer = event.fontRenderer
val text = renderObject.text
- val x = event.x + 17 - fontRenderer.getStringWidth(text) + renderObject.offsetX
+ val x = event.x + 17 + renderObject.offsetX
val y = event.y + 9 + renderObject.offsetY
- fontRenderer.drawStringWithShadow(text, x.toFloat(), y.toFloat(), 16777215)
- }
- GlStateManager.enableLighting()
- GlStateManager.enableDepth()
+ RenderUtils.drawSlotText(x, y, text, 1f)
+ }
}
@SubscribeEvent(priority = EventPriority.HIGHEST)