diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/PetCandyUsedDisplay.kt | 25 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt | 22 |
2 files changed, 7 insertions, 40 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/PetCandyUsedDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/PetCandyUsedDisplay.kt index 5cfcd881d..ea3246ac5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/PetCandyUsedDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/PetCandyUsedDisplay.kt @@ -3,8 +3,8 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.GuiRenderItemEvent import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.RenderUtils import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getPetCandyUsed -import net.minecraft.client.renderer.GlStateManager import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class PetCandyUsedDisplay { @@ -20,26 +20,9 @@ class PetCandyUsedDisplay { if (petCandyUsed == 0) return val stackTip = "§c$petCandyUsed" - - GlStateManager.disableLighting() - GlStateManager.disableDepth() - GlStateManager.disableBlend() - - val fontRenderer = event.fontRenderer - val x = event.x + 13 - fontRenderer.getStringWidth(stackTip) + val x = event.x + 13 val y = event.y + 1 - val scale = 0.9 - GlStateManager.pushMatrix() - GlStateManager.translate(x.toFloat(), y.toFloat(), 0f) - GlStateManager.scale(scale, scale, scale) - fontRenderer.drawStringWithShadow(stackTip, 0f, 0f, 16777215) - val reverseScale = 1 / 0.7 - GlStateManager.scale(reverseScale, reverseScale, reverseScale) - GlStateManager.popMatrix() - - GlStateManager.enableLighting() - GlStateManager.enableDepth() + RenderUtils.drawSlotText(x, y, stackTip, .9f) } - -} +}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt index 0ed156362..a1c780199 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt @@ -5,8 +5,8 @@ import at.hannibal2.skyhanni.events.GuiRenderItemEvent import at.hannibal2.skyhanni.events.LorenzToolTipEvent import at.hannibal2.skyhanni.utils.ItemUtils import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.RenderUtils import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getAppliedPocketSackInASack -import net.minecraft.client.renderer.GlStateManager import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class PocketSackInASackDisplay { @@ -22,26 +22,10 @@ class PocketSackInASackDisplay { val pocketSackInASackApplied = stack.getAppliedPocketSackInASack() ?: return val stackTip = "§a$pocketSackInASackApplied" - - GlStateManager.disableLighting() - GlStateManager.disableDepth() - GlStateManager.disableBlend() - - val fontRenderer = event.fontRenderer - val x = event.x + 13 - fontRenderer.getStringWidth(stackTip) + val x = event.x + 13 val y = event.y + 1 - val scale = 0.9 - GlStateManager.pushMatrix() - GlStateManager.translate(x.toFloat(), y.toFloat(), 0f) - GlStateManager.scale(scale, scale, scale) - fontRenderer.drawStringWithShadow(stackTip, 0f, 0f, 16777215) - val reverseScale = 1 / 0.7 - GlStateManager.scale(reverseScale, reverseScale, reverseScale) - GlStateManager.popMatrix() - - GlStateManager.enableLighting() - GlStateManager.enableDepth() + RenderUtils.drawSlotText(x, y, stackTip, .9f) } @SubscribeEvent |