Clear depth after rendering item stack icons

This commit is contained in:
DBotThePony 2023-07-08 01:08:48 +07:00
parent e084221fde
commit 109145c3ce
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -48,6 +48,7 @@ data class ItemStackIcon(private val itemStack: ItemStack, val width: Float = 16
override fun render(guiGraphics: GuiGraphics, x: Float, y: Float, width: Float, height: Float) {
if (x % 1f == 0f && y % 1f == 0f && width == 16f && height == 16f) {
guiGraphics.renderFakeItem(itemStack, x.toInt(), y.toInt())
clearDepth(guiGraphics.pose(), x, y, width, height)
} else {
val pose = guiGraphics.pose()
@ -59,6 +60,8 @@ data class ItemStackIcon(private val itemStack: ItemStack, val width: Float = 16
guiGraphics.renderFakeItem(itemStack, x.toInt(), y.toInt())
pose.popPose()
clearDepth(pose, x, y, width, height)
}
}
}