Skip to content

Commit

Permalink
Update to 1.20.4
Browse files Browse the repository at this point in the history
  • Loading branch information
JustAlittleWolf committed Dec 21, 2023
1 parent 6010f1f commit 4eb37e0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.20.2
yarn_mappings=1.20.2+build.4
loader_version=0.14.24
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.3
loader_version=0.15.3

# Mod Properties
mod_version=1.1.2
maven_group=me.wolfii
archives_base_name=SmoothScrollingRefurbished+1.20.2
archives_base_name=SmoothScrollingRefurbished+1.20.4
9 changes: 3 additions & 6 deletions src/main/java/me/wolfii/mixin/EntryListWidgetMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,16 @@
public abstract class EntryListWidgetMixin {
@Shadow
private double scrollAmount;
@Shadow
protected int bottom;

@Shadow
public abstract int getMaxScroll();

@Unique
private double animationTimer = 0;
@Unique
private double scrollStartVelocity = 0;
@Unique
private boolean renderSmooth = false;

@Inject(method = "render", at = @At("HEAD"))
@Inject(method = "renderWidget", at = @At("HEAD"))
private void manipulateScrollAmount(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
renderSmooth = true;
checkOutOfBounds(delta);
Expand Down Expand Up @@ -72,11 +68,12 @@ private void setVelocity(EntryListWidget<?> instance, double amount) {
animationTimer = 0;
}

@Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/DrawContext;drawGuiTexture(Lnet/minecraft/util/Identifier;IIII)V"))
@Redirect(method = "renderWidget", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/DrawContext;drawGuiTexture(Lnet/minecraft/util/Identifier;IIII)V"))
private void modifyScrollbar(DrawContext instance, Identifier texture, int x, int y, int width, int height) {
if (scrollAmount < 0) {
height -= ScrollMath.dampenSquish(Math.abs(scrollAmount), height);
}
int bottom = ((EntryListWidget<?>) (Object) this).getBottom();
if (y + height > bottom) {
y = bottom - height;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
],
"depends": {
"fabricloader": ">=0.14.0",
"minecraft": "1.20.2",
"minecraft": ">1.20.2 <=1.20.4",
"java": ">=17"
}
}

0 comments on commit 4eb37e0

Please sign in to comment.