Skip to content

Commit

Permalink
Fix multiplayerlist scrollspeed
Browse files Browse the repository at this point in the history
  • Loading branch information
JustAlittleWolf committed Nov 15, 2023
1 parent 5753c1b commit 5cd3caf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ yarn_mappings=1.20.2+build.4
loader_version=0.14.24

# Mod Properties
mod_version=1.1.0
mod_version=1.1.1
maven_group=me.wolfii
archives_base_name=SmoothScrollingRefurbished+1.20.2

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/me/wolfii/Config.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.wolfii;

public class Config {
public static double scrollSpeed = 0.6;
public static double scrollSpeed = 0.5;
public static double scrollbarDrag= 0.025;
public static double animationDuration = 1.0;
public static double pushBackStrength = 1.0;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/me/wolfii/mixin/EntryListWidgetMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,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 setVelocity(EntryListWidget<?> instance, double amount) {
double diff = amount - scrollAmount;
diff = Math.signum(diff) * Math.min(Math.abs(diff), 10);
diff *= Config.scrollSpeed;
if (Math.signum(diff) != Math.signum(scrollStartVelocity)) diff *= 2.5d;
animationTimer *= 0.5;
Expand Down

0 comments on commit 5cd3caf

Please sign in to comment.