Skip to content

Commit

Permalink
Override correct render method
Browse files Browse the repository at this point in the history
  • Loading branch information
BrokenK3yboard committed Nov 21, 2024
1 parent c19bb2d commit 92c67f2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dependencies.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
neoforge=21.1.65
neoforge=21.1.77
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public CategoryButton(int x, int y, int w, int h, Component text, ItemStack icon
}

@Override
public void render(@NotNull GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) { //Todo: Are we able to fix this on Neoforge?
public void renderWidget(@NotNull GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
super.render(guiGraphics, mouseX, mouseY, partialTicks);

if(!active)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ public void removeChildWidgets(Consumer<AbstractWidget> removeWidget) {
// list.reenableVisibleWidgets();

@Override
public void render(@NotNull GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
public void renderWidget(@NotNull GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
//turn off wasOnScreen, then render widget - minecraft does some simple culling when rendering,
//and as a side effect of Entry.render, wasOnScreen will be turned back on
forEachWidgetWrapper(w -> {
w.widget.visible = false;
w.wasOnScreen = false;
});
super.render(guiGraphics, mouseX, mouseY, partialTicks);
super.renderWidget(guiGraphics, mouseX, mouseY, partialTicks);
}

public void reenableVisibleWidgets() {
Expand Down

0 comments on commit 92c67f2

Please sign in to comment.