Fix item icons not being rendered correctly
This commit is contained in:
parent
8d42686cc5
commit
cae417b3b4
@ -129,7 +129,7 @@ data class ItemStackIcon(private val itemStack: ItemStack, override val width: F
|
|||||||
pose.scale(width / 16f, height / 16f, 1f)
|
pose.scale(width / 16f, height / 16f, 1f)
|
||||||
|
|
||||||
guiGraphics.setColor(color.red, color.green, color.blue, color.alpha)
|
guiGraphics.setColor(color.red, color.green, color.blue, color.alpha)
|
||||||
guiGraphics.renderFakeItem(itemStack, 0, 0)
|
guiGraphics.renderFakeItem(pose, itemStack, 0, 0)
|
||||||
pose.popPose()
|
pose.popPose()
|
||||||
|
|
||||||
clearDepth(pose, x, y, width, height)
|
clearDepth(pose, x, y, width, height)
|
||||||
|
@ -34,8 +34,15 @@ class MGUIGraphics(val pose: PoseStack) {
|
|||||||
RenderSystem.setShaderColor(red, green, blue, alpha)
|
RenderSystem.setShaderColor(red, green, blue, alpha)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun renderFakeItem(itemStack: ItemStack, x: Int, y: Int) {
|
fun renderFakeItem(poseStack: PoseStack, itemStack: ItemStack, x: Int, y: Int) {
|
||||||
|
val global = RenderSystem.getModelViewStack()
|
||||||
|
global.pushPose()
|
||||||
|
global.last().pose().mul(poseStack.last().pose())
|
||||||
|
global.last().normal().mul(poseStack.last().normal())
|
||||||
|
RenderSystem.applyModelViewMatrix()
|
||||||
minecraft.itemRenderer.renderGuiItem(itemStack, x, y)
|
minecraft.itemRenderer.renderGuiItem(itemStack, x, y)
|
||||||
|
global.popPose()
|
||||||
|
RenderSystem.applyModelViewMatrix()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun drawLine(
|
fun drawLine(
|
||||||
|
Loading…
Reference in New Issue
Block a user