mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 06:28:49 +00:00
Fix player cache not being updated on single-server mode, make #getNetworkMessenger @NotNull
This commit is contained in:
1 parent
a952a372cc
commit
90291196f9
9 files changed
+31
-30
No files matched your search
@@ -93,10 +93,8 @@ public class Cache {
|
||||
*
|
||||
* @param plugin the implementing plugin
|
||||
*/
|
||||
public CompletableFuture<List<String>> fetchAndCacheGlobalPlayerList(@NotNull HuskHomes plugin,
|
||||
@NotNull OnlineUser requester) {
|
||||
public CompletableFuture<List<String>> updatePlayerListCache(@NotNull HuskHomes plugin, @NotNull OnlineUser requester) {
|
||||
if (plugin.getSettings().crossServer) {
|
||||
assert plugin.getNetworkMessenger() != null;
|
||||
return plugin.getNetworkMessenger().getOnlinePlayerNames(requester).thenApply(returnedPlayerList -> {
|
||||
players.clear();
|
||||
players.addAll(List.of(returnedPlayerList));
|
||||
@@ -109,6 +107,7 @@ public class Cache {
|
||||
.filter(player -> !player.isVanished())
|
||||
.map(onlineUser -> onlineUser.username)
|
||||
.toList());
|
||||
System.out.println(String.join(", ", players));
|
||||
return CompletableFuture.completedFuture(players);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user