diff --git a/common/src/main/java/me/shedaniel/clothconfig2/gui/widget/DynamicEntryListWidget.java b/common/src/main/java/me/shedaniel/clothconfig2/gui/widget/DynamicEntryListWidget.java index 30faaf48..318a4b65 100644 --- a/common/src/main/java/me/shedaniel/clothconfig2/gui/widget/DynamicEntryListWidget.java +++ b/common/src/main/java/me/shedaniel/clothconfig2/gui/widget/DynamicEntryListWidget.java @@ -49,10 +49,11 @@ import java.util.stream.Collectors; @Environment(EnvType.CLIENT) -public abstract class DynamicEntryListWidget> extends AbstractContainerEventHandler implements TickableWidget, Widget { +public abstract class DynamicEntryListWidget> extends AbstractContainerEventHandler implements Widget { protected static final int DRAG_OUTSIDE = -2; protected final Minecraft client; private final List entries = new Entries(); + private float totalTicks = 1.0f; private List visibleEntries = Collections.emptyList(); public int width; public int height; @@ -213,8 +214,7 @@ protected int getMaxScrollPosition() { protected void clickedHeader(int int_1, int int_2) { } - @Override - public void tick() { + public void tickList() { this.updateVisibleChildren(); for (E child : this.children()) { child.tick(); @@ -247,6 +247,12 @@ protected void renderBackBackground(PoseStack matrices, BufferBuilder buffer, Te @SuppressWarnings("deprecation") @Override public void render(PoseStack matrices, int mouseX, int mouseY, float delta) { + this.totalTicks += delta; + if (this.totalTicks >= 1.0f) { + this.totalTicks = this.totalTicks % 1.0f; + this.tickList(); + } + this.drawBackground(); int scrollbarPosition = this.getScrollbarPosition(); int int_4 = scrollbarPosition + 6;