aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-02-26 15:37:56 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-02-26 15:37:56 +0100
commitc15c3d2db212f2fb73e6063aa5ff3cc2b5a7a4f5 (patch)
treedf378748160d120637459ef5e6e0b658cf899fce /src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
parent52a6ff3c2ce36c2e0c8bccea09f412e6f86c922a (diff)
downloadskyhanni-c15c3d2db212f2fb73e6063aa5ff3cc2b5a7a4f5.tar.gz
skyhanni-c15c3d2db212f2fb73e6063aa5ff3cc2b5a7a4f5.tar.bz2
skyhanni-c15c3d2db212f2fb73e6063aa5ff3cc2b5a7a4f5.zip
Start fixing gui rendering logic.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
index dc0683b27..13366c969 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
@@ -5,7 +5,9 @@ import io.github.moulberry.notenoughupdates.NEUManager
import io.github.moulberry.notenoughupdates.NotEnoughUpdates
import io.github.moulberry.notenoughupdates.util.ItemResolutionQuery
import io.github.moulberry.notenoughupdates.util.Utils
+import net.minecraft.client.Minecraft
import net.minecraft.client.renderer.GlStateManager
+import net.minecraft.client.renderer.RenderHelper
import net.minecraft.init.Items
import net.minecraft.item.ItemStack
@@ -79,8 +81,21 @@ object NEUItems {
}
val scale = if (isSkull) 0.8f else 0.6f
- GlStateManager.scale(scale, scale, 1f)
- Utils.drawItemStack(this, 0, 0)
+ GlStateManager.scale(scale, scale, 0f)
+ drawItemStack(this)
GlStateManager.popMatrix()
}
+
+ private fun drawItemStack(stack: ItemStack) {
+ val itemRender = Minecraft.getMinecraft().renderItem
+
+ Utils.disableCustomDungColours = true
+ RenderHelper.enableGUIStandardItemLighting()
+ Utils.hasEffectOverride = true
+ itemRender.renderItemAndEffectIntoGUI(stack, 0, 0)
+ itemRender.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRendererObj, stack, 0, 0, null)
+ Utils.hasEffectOverride = false
+ RenderHelper.disableStandardItemLighting()
+ Utils.disableCustomDungColours = false
+ }
} \ No newline at end of file