Skip to content

Commit 63e6a90

Browse files
committed
fix scroll thing
1 parent 1c8afc9 commit 63e6a90

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/main/java/dev/isxander/yacl3/gui/ModernSelectionList.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,18 @@
1010
import net.minecraft.client.input.MouseButtonInfo;
1111

1212
public abstract class ModernSelectionList<E extends ModernSelectionList.Entry<E>> extends ContainerObjectSelectionList<E> {
13-
private Double prevScrollAmount = null;
13+
private boolean doneRefresh;
1414

1515
public ModernSelectionList(Minecraft minecraft, int width, int height, int y, int defaultEntryHeight) {
1616
super(minecraft, width, height, y, defaultEntryHeight);
1717
}
1818

1919
@Override
2020
public void renderWidget(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) {
21-
if (this.prevScrollAmount == null || this.prevScrollAmount != this.scrollAmount()) {
22-
this.prevScrollAmount = this.scrollAmount();
23-
System.out.println(this.scrollAmount());
21+
// idk why but the scroll is broken initially and this fixes it.
22+
if (!doneRefresh) {
23+
this.repositionEntries();
24+
this.doneRefresh = true;
2425
}
2526

2627
super.renderWidget(guiGraphics, mouseX, mouseY, partialTick);

0 commit comments

Comments
 (0)