Merge branch '1.19.3' into 1.19.2

This commit is contained in:
DBotThePony 2024-01-02 14:39:05 +07:00
commit 5f60ae1896
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 9 additions and 2 deletions

View File

@ -129,7 +129,7 @@ data class ItemStackIcon(private val itemStack: ItemStack, override val width: F
pose.scale(width / 16f, height / 16f, 1f)
guiGraphics.setColor(color.red, color.green, color.blue, color.alpha)
guiGraphics.renderFakeItem(itemStack, 0, 0)
guiGraphics.renderFakeItem(pose, itemStack, 0, 0)
pose.popPose()
clearDepth(pose, x, y, width, height)

View File

@ -33,8 +33,15 @@ class MGUIGraphics(val pose: PoseStack) {
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)
global.popPose()
RenderSystem.applyModelViewMatrix()
}
fun drawLine(