Skip to content

Commit 5bfdd41

Browse files
clear depth if not in-world gui
1 parent 78e3377 commit 5bfdd41

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/java/com/gregtechceu/gtceu/client/mui/screen/ModularScreen.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import org.jetbrains.annotations.MustBeInvokedByOverriders;
4646
import org.jetbrains.annotations.NotNull;
4747
import org.jetbrains.annotations.Nullable;
48+
import org.lwjgl.opengl.GL11;
4849

4950
import java.util.*;
5051
import java.util.function.Consumer;
@@ -354,6 +355,11 @@ public void drawForeground(GuiGraphics guiGraphics, float partialTicks) {
354355
if (panel.isEnabled()) {
355356
WidgetTree.drawTreeForeground(panel, this.context);
356357
}
358+
if (this.getContainer().inWorldID == -1) {
359+
// clear depth, so that anything drawn next will be guaranteed to be on top
360+
RenderSystem.clearDepth(1);
361+
RenderSystem.clear(GL11.GL_DEPTH_BUFFER_BIT, Minecraft.ON_OSX);
362+
}
357363
}
358364
this.context.drawDraggable(guiGraphics);
359365
this.context.popViewport(null);

0 commit comments

Comments
 (0)