Skip to content

Commit

Permalink
fix lighting
Browse files Browse the repository at this point in the history
  • Loading branch information
khjxiaogu committed Dec 8, 2024
1 parent b1ff92e commit 08ceb30
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ public static void drawItem(GuiGraphics guiGraphics, ItemStack stack, int x, int
// }else {
// guiGraphics.renderItem( stack, 0, 0,0,-50);
// }c
Matrix4f matrix4f = new Matrix4f(guiGraphics.pose().last().pose()).rotationYXZ(1.0821041F, 3.2375858F, 0.0F).rotateYXZ((-(float)Math.PI / 8F), 2.3561945F, 0.0F);

if (!stack.isEmpty()) {
BakedModel bakedmodel = ClientUtils.mc().getItemRenderer().getModel(stack, ClientUtils.mc().level,
ClientUtils.mc().player, 0);
Expand All @@ -147,8 +149,7 @@ public static void drawItem(GuiGraphics guiGraphics, ItemStack stack, int x, int
if (flag) {
Lighting.setupForFlatItems();
}else {
Matrix4f matrix4f = (new Matrix4f()).rotationYXZ(1.0821041F, 3.2375858F, 0.0F).rotateYXZ((-(float)Math.PI / 8F), 2.3561945F, 0.0F).translate(0, 0, 150);
Lighting.setupLevel(matrix4f);
Lighting.setupLevel(matrix4f);
}

ClientUtils.mc().getItemRenderer().render(stack, ItemDisplayContext.GUI, false, guiGraphics.pose(),
Expand All @@ -159,7 +160,8 @@ public static void drawItem(GuiGraphics guiGraphics, ItemStack stack, int x, int
}
guiGraphics.pose().popPose();
}
guiGraphics.renderItemDecorations(ClientUtils.mc().font, stack, 0, 0, countReplacement);
if(drawDecorations)
guiGraphics.renderItemDecorations(ClientUtils.mc().font, stack, 0, 0, countReplacement);
guiGraphics.pose().popPose();
}

Expand Down

0 comments on commit 08ceb30

Please sign in to comment.