Skip to content

Commit 0e4e938

Browse files
committed
Fix some z-level issues of items in crafting windows
1 parent 8422973 commit 0e4e938

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/main/java/mekanism/client/gui/GuiMekanism.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,8 @@ protected void renderLabels(@NotNull GuiGraphics guiGraphics, int mouseX, int mo
362362
pose.popPose();
363363
}
364364
pose.popPose();
365+
//Additionally hacky offset to make it so that we render above items in higher z-levels for things like tooltips and held items
366+
maxZOffset += 200;
365367
// then render tooltips, translating above max z offset to prevent clashing
366368
// It is IMPORTANT that we do this to ensure any delayed rendering we do the for the tooltip happens above the other things
367369
// and so that we let the translation leak out into the super method so that the carried item renders at the correct z level

src/main/java/mekanism/client/render/RenderTickHandler.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,7 @@ public void renderPostHighest(ScreenEvent.Render.Post event) {
152152
// Note: We will pop this in a listener at the lowest priority
153153
PoseStack pose = event.getGuiGraphics().pose();
154154
pose.pushPose();
155-
//Note: We translate forward an extra 200, so that items rendered in a gui window don't overlap EMI based tooltips
156-
pose.translate(0, 0, 200 + GuiMekanism.maxZOffset);
155+
pose.translate(0, 0, GuiMekanism.maxZOffset);
157156
}
158157
}
159158

0 commit comments

Comments
 (0)