Skip to content

Commit

Permalink
Make the 1.21.2 release 1.21.4-compatible
Browse files Browse the repository at this point in the history
The catch is: it's a Fabric-only trick, for good reasons (god keeping this hack would be so messy)
  • Loading branch information
EnnuiL committed Nov 27, 2024
1 parent 06ffac7 commit 7a56a65
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,12 @@ public void updateSizeAndPosition(int width, int height, int y) {
this.update();
}

// 1.21.4-exclusive method
// @Override
protected int contentHeight() {
return this.contentHeight;
}

protected void ensureVisible(int index) {
int rowTop = this.getRowTop(index);
int rowTop2 = rowTop - this.getY() - 4 - entryHeights.getInt(index);
Expand All @@ -310,6 +316,12 @@ protected void ensureVisible(int index) {
}
}

// 1.21.4-exclusive method
//@Override
protected double scrollRate() {
return 10.0;
}

// This is so faithful to Vanilla's algo that it also inherits the Bottom Void Pixel of Doom! Oh no!
protected final Entry getEntryAtPosition(double x, double y) {
int center = this.getX() + this.width / 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ private static void fadeCrosshair(CallbackInfo ci) {
@Inject(
method = {
"method_62268",
"method_65205", // Intermediary 1.21.4
"lambda$static$15()V"
},
at = @At("HEAD"),
Expand Down
2 changes: 1 addition & 1 deletion norge/src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ side = "CLIENT"
[[dependencies.ok_zoomer]]
modId = "minecraft"
type = "required"
versionRange = "[1.21.2,1.22)"
versionRange = "[1.21.2,1.21.4)"
ordering = "NONE"
side = "CLIENT"

Expand Down

0 comments on commit 7a56a65

Please sign in to comment.