From d9e12b81aecec8b08ecb993befa4ca28f0212b1f Mon Sep 17 00:00:00 2001 From: Zailer43 Date: Thu, 27 Jul 2023 14:39:03 -0300 Subject: [PATCH 1/2] Fix armor trim rendering in ItemComponent (Fix #152) --- .../java/io/wispforest/owo/ui/component/ItemComponent.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/wispforest/owo/ui/component/ItemComponent.java b/src/main/java/io/wispforest/owo/ui/component/ItemComponent.java index a99e3865..feb525d4 100644 --- a/src/main/java/io/wispforest/owo/ui/component/ItemComponent.java +++ b/src/main/java/io/wispforest/owo/ui/component/ItemComponent.java @@ -83,14 +83,16 @@ public void draw(OwoUIDrawContext context, int mouseX, int mouseY, float partial matrices.multiplyPositionMatrix(ITEM_SCALING); } - this.itemRenderer.renderItem(this.stack, ModelTransformationMode.GUI, LightmapTextureManager.MAX_LIGHT_COORDINATE, OverlayTexture.DEFAULT_UV, matrices, entityBuffers, null, 0); + MinecraftClient client = MinecraftClient.getInstance(); + + this.itemRenderer.renderItem(this.stack, ModelTransformationMode.GUI, LightmapTextureManager.MAX_LIGHT_COORDINATE, OverlayTexture.DEFAULT_UV, matrices, entityBuffers, client.world, 0); this.entityBuffers.draw(); // Clean up matrices.pop(); if (this.showOverlay) { - context.drawItemInSlot(MinecraftClient.getInstance().textRenderer, this.stack, this.x, this.y); + context.drawItemInSlot(client.textRenderer, this.stack, this.x, this.y); } if (notSideLit) { DiffuseLighting.enableGuiDepthLighting(); From f2b18660b9c86b2d97d6e1968bd6eae8b01aa8af Mon Sep 17 00:00:00 2001 From: Zailer43 Date: Tue, 1 Aug 2023 07:54:23 -0300 Subject: [PATCH 2/2] Changes an explicit type to a var --- src/main/java/io/wispforest/owo/ui/component/ItemComponent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/wispforest/owo/ui/component/ItemComponent.java b/src/main/java/io/wispforest/owo/ui/component/ItemComponent.java index feb525d4..4ebc6d30 100644 --- a/src/main/java/io/wispforest/owo/ui/component/ItemComponent.java +++ b/src/main/java/io/wispforest/owo/ui/component/ItemComponent.java @@ -83,7 +83,7 @@ public void draw(OwoUIDrawContext context, int mouseX, int mouseY, float partial matrices.multiplyPositionMatrix(ITEM_SCALING); } - MinecraftClient client = MinecraftClient.getInstance(); + var client = MinecraftClient.getInstance(); this.itemRenderer.renderItem(this.stack, ModelTransformationMode.GUI, LightmapTextureManager.MAX_LIGHT_COORDINATE, OverlayTexture.DEFAULT_UV, matrices, entityBuffers, client.world, 0); this.entityBuffers.draw();