diff --git a/src/main/java/io/github/gaming32/worldhost/gui/screen/AddFriendScreen.java b/src/main/java/io/github/gaming32/worldhost/gui/screen/AddFriendScreen.java index 73dd7a8..b7a5b58 100644 --- a/src/main/java/io/github/gaming32/worldhost/gui/screen/AddFriendScreen.java +++ b/src/main/java/io/github/gaming32/worldhost/gui/screen/AddFriendScreen.java @@ -127,11 +127,15 @@ protected void init() { .build() ); - maxFriends = (cancelY - 90) / 24; + //#if MC >= 1.21.4 + maxFriends = 25; + //#else + //$$ maxFriends = (cancelY - 94) / 24; + //#endif userList = addRenderableWidget(new UserListWidget( font, - widgetsX, 90, widgetsWidth, cancelY - 90, + widgetsX, 90, widgetsWidth, cancelY - 94, this::getActions, userList )); 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 acbc8e2..f55a2fe 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 @@ -1,5 +1,6 @@ package io.github.gaming32.worldhost.gui.widget; +import com.google.common.collect.Lists; import com.mojang.blaze3d.systems.RenderSystem; import io.github.gaming32.worldhost.WorldHost; import io.github.gaming32.worldhost.gui.screen.WorldHostScreen; @@ -46,7 +47,8 @@ public final class UserListWidget //#endif { private final List users = new ArrayList<>(); - private final List