mirror of
https://github.com/CivMC/Civ.git
synced 2026-07-18 00:20:44 +00:00
fix null player name
This commit is contained in:
@@ -59,7 +59,9 @@ public class CommandManager extends BukkitCommandManager {
|
||||
public final void init() {
|
||||
// Prepare our list with player names on init.
|
||||
// Load all known players once on initialization, then use a loginlistener to update the existing name set.
|
||||
Arrays.stream(Bukkit.getOfflinePlayers()).map(OfflinePlayer::getName).forEach(autocompletePlayerNames::add);
|
||||
Arrays.stream(Bukkit.getOfflinePlayers()).map(OfflinePlayer::getName)
|
||||
.filter(Objects::nonNull)
|
||||
.forEach(autocompletePlayerNames::add);
|
||||
/*TODO
|
||||
this may be better solved with a single global listener, but the implications would've needed some checks.
|
||||
This is pretty cheap and works fast.
|
||||
|
||||
Reference in New Issue
Block a user