Skip to content

Commit

Permalink
pushbackstrength adjusted
Browse files Browse the repository at this point in the history
  • Loading branch information
JustAlittleWolf committed Nov 15, 2023
1 parent 83d5248 commit 5753c1b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/main/java/me/wolfii/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ public class Config {
public static double scrollSpeed = 0.6;
public static double scrollbarDrag= 0.025;
public static double animationDuration = 1.0;
public static double pushBackStrength = 1.0;
}
2 changes: 1 addition & 1 deletion src/main/java/me/wolfii/ScrollMath.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ public static int dampenSquish(double squish, int height) {
}

public static double pushBackStrength(double distance, float delta) {
return ((distance + 4d) * delta / 0.3d) / 4.0d;
return ((distance + 4d) * delta / 0.3d) / (3.2d/ Config.pushBackStrength);
}
}
2 changes: 1 addition & 1 deletion src/main/java/me/wolfii/mixin/EntryListWidgetMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private void checkOutOfBounds(float delta) {
}

@Redirect(method = "mouseScrolled", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/widget/EntryListWidget;setScrollAmount(D)V"))
private void setTarget(EntryListWidget<?> instance, double amount) {
private void setVelocity(EntryListWidget<?> instance, double amount) {
double diff = amount - scrollAmount;
diff *= Config.scrollSpeed;
if (Math.signum(diff) != Math.signum(scrollStartVelocity)) diff *= 2.5d;
Expand Down

0 comments on commit 5753c1b

Please sign in to comment.