Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/main/java/dev/isxander/yacl3/gui/ElementListWidgetExt.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import net.minecraft.client.gui.navigation.ScreenRectangle;
import net.minecraft.util.Mth;
import org.jetbrains.annotations.Nullable;
import org.lwjgl.glfw.GLFW;

import java.util.function.Consumer;

Expand Down Expand Up @@ -70,13 +69,12 @@ protected int scrollBarY() {
}
*///?}

//? if >=1.21.6 {

/*@Override
//? if >=1.21.5 {
@Override
public int maxScrollAmount() {
return super.maxScrollAmount() + 5;
}
*///?}
//?}

@Override
public void renderWidget(GuiGraphics graphics, int mouseX, int mouseY, float delta) {
Expand Down Expand Up @@ -203,7 +201,7 @@ protected int getMaxPosition() {
@Override
protected int contentHeight() {
//?}
return children().stream().map(E::getItemHeight).reduce(0, Integer::sum) + headerHeight;
return children().stream().mapToInt(E::getItemHeight).sum() + headerHeight;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) {

@Override
public boolean mouseScrolled(double mouseX, double mouseY, double horizontal, double vertical) {
this.setScrollOffset(this.scrollOffset - (int)(vertical*15));
this.setScrollOffset(this.scrollOffset - (int) (vertical * 15) - (int) (horizontal * 15));
return true;
}

Expand Down