diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-02-26 15:37:56 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-02-26 15:37:56 +0100 |
commit | c15c3d2db212f2fb73e6063aa5ff3cc2b5a7a4f5 (patch) | |
tree | df378748160d120637459ef5e6e0b658cf899fce /src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt | |
parent | 52a6ff3c2ce36c2e0c8bccea09f412e6f86c922a (diff) | |
download | skyhanni-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.kt | 19 |
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 |