Skip to content

Commit

Permalink
Fix ModularGuiContainer background rendering overtop the GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
brandon3055 committed Nov 8, 2024
1 parent bd5cad0 commit 883120f
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ public void render(@NotNull GuiGraphics graphics, int mouseX, int mouseY, float
imageHeight = (int) root.getValue(GeoParam.HEIGHT);

if (modularGui.renderBackground()) {
renderBackground(graphics, mouseX, mouseY, partialTicks);
//Called here to ensure background renders before modularGui elements.
super.renderBackground(graphics, mouseX, mouseY, partialTicks);
}
GuiRender render = GuiRender.convert(graphics);//modularGui.createRender(graphics.bufferSource());
GuiRender render = GuiRender.convert(graphics);
modularGui.render(render, partialTicks);

super.render(graphics, mouseX, mouseY, partialTicks);
Expand All @@ -88,6 +89,11 @@ public void render(@NotNull GuiGraphics graphics, int mouseX, int mouseY, float
}
}

@Override
public void renderBackground(GuiGraphics graphics, int mouseX, int mouseY, float partialTick) {
//Stubbed to avoid the above super.render() call from rendering the background again.
}

protected boolean handleFloatingItemRender(GuiRender render, int mouseX, int mouseY) {
if (modularGui.vanillaSlotRendering()) return false;
boolean ret = false;
Expand Down

0 comments on commit 883120f

Please sign in to comment.