diff --git a/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/FriendMainPage.java b/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/FriendMainPage.java index 2874ea9ea..0a7d4c92a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/FriendMainPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/friend/ui/FriendMainPage.java @@ -1,5 +1,7 @@ package mineplex.core.friend.ui; +import java.util.HashSet; +import java.util.Set; import java.util.function.Predicate; import java.util.stream.Collectors; @@ -47,6 +49,7 @@ public class FriendMainPage extends ShopPageBase } } + private final Set _shown; private final MultiPageManager _pageManager; private FriendPageType _pageType; @@ -54,10 +57,20 @@ public class FriendMainPage extends ShopPageBase { super(plugin, shop, clientManager, donationManager, "Friends", player); + _shown = new HashSet<>(); _pageManager = new MultiPageManager<>(this, () -> getPlugin().Get(player).stream() .filter(_pageType.Filter) .sorted(FriendManager.getFriendSorter()) - .collect(Collectors.toList()), this::buildItem); + .collect(Collectors.toList()), (status, slot) -> + { + if (_shown.add(status.Name)) + { + buildItem(status, slot); + return true; + } + + return false; + }); _pageType = FriendPageType.MAIN; buildPage(); @@ -67,6 +80,8 @@ public class FriendMainPage extends ShopPageBase @Override protected void buildPage() { + _shown.clear(); + int slot = 0; for (FriendPageType pageType : FriendPageType.values())