diff --git a/src/main/java/io/github/gaming32/worldhost/gui/screen/OnlineFriendsScreen.java b/src/main/java/io/github/gaming32/worldhost/gui/screen/OnlineFriendsScreen.java index f1554dc..d3ffc71 100644 --- a/src/main/java/io/github/gaming32/worldhost/gui/screen/OnlineFriendsScreen.java +++ b/src/main/java/io/github/gaming32/worldhost/gui/screen/OnlineFriendsScreen.java @@ -297,10 +297,12 @@ public boolean keyPressed(int keyCode, int scanCode, int modifiers) { return (entry != null && entry.keyPressed(keyCode, scanCode, modifiers)) || super.keyPressed(keyCode, scanCode, modifiers); } - @Override - protected int getScrollbarPosition() { - return super.getScrollbarPosition() + 30; - } + //#if MC < 1.21.4 + //$$ @Override + //$$ protected int getScrollbarPosition() { + //$$ return super.getScrollbarPosition() + 30; + //$$ } + //#endif @Override public int getRowWidth() { diff --git a/src/main/java/io/github/gaming32/worldhost/gui/widget/UserListWidget.java b/src/main/java/io/github/gaming32/worldhost/gui/widget/UserListWidget.java index 4ef0679..acbc8e2 100644 --- a/src/main/java/io/github/gaming32/worldhost/gui/widget/UserListWidget.java +++ b/src/main/java/io/github/gaming32/worldhost/gui/widget/UserListWidget.java @@ -183,7 +183,11 @@ private void addButtons(int fromI) { } public int getVisibleCount() { - return Math.min(users.size(), getHeight() / 24); + //#if MC >= 1.21.4 + return users.size(); + //#else + //$$ return Math.min(users.size(), getHeight() / 24); + //#endif } @Override @@ -191,6 +195,18 @@ public int getVisibleCount() { return actionButtons; } + //#if MC >= 1.21.4 + @Override + protected int contentHeight() { + return 24 * users.size(); + } + + @Override + protected double scrollRate() { + return 12.0; + } + //#endif + //#if MC < 1.19.4 //$$ private int getX() { //$$ return x; diff --git a/src/main/resources/META-INF/neoforge.mods.toml b/src/main/resources/META-INF/neoforge.mods.toml index b5c8008..5f16366 100644 --- a/src/main/resources/META-INF/neoforge.mods.toml +++ b/src/main/resources/META-INF/neoforge.mods.toml @@ -31,9 +31,9 @@ modId = "minecraft" ##elseif MC == 1.21.1 #?? versionRange = "[1.21.0,1.21.2)" ##elseif MC == 1.21.3 -versionRange = "[1.21.2,1.21.4)" +#?? versionRange = "[1.21.2,1.21.4)" ##else -#?? versionRange = "[$mc_version]" +versionRange = "[$mc_version]" ##endif type = "required" ordering = "NONE" diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 5166f31..a3ad8ac 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -45,9 +45,9 @@ //#elseif MC == 1.21.1 //?? "minecraft": ">=1.21.0 <1.21.2", //#elseif MC == 1.21.3 - "minecraft": ">=1.21.2 <1.21.4", + //?? "minecraft": ">=1.21.2 <1.21.4", //#else - //?? "minecraft": "$mc_version", + "minecraft": "$mc_version", //#endif "fabric-resource-loader-v0": "*" }, diff --git a/versions/mainProject b/versions/mainProject index 71a33c8..940b501 100644 --- a/versions/mainProject +++ b/versions/mainProject @@ -1 +1 @@ -1.21.3-fabric \ No newline at end of file +1.21.4-fabric \ No newline at end of file