mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 14:38:52 +00:00
Fix /tp command with players, remove unhelpful TAB completion
This commit is contained in:
1 parent
9bdf67c250
commit
5faab57d8e
7 files changed
+143
-133
No files matched your search
@@ -61,13 +61,14 @@ public interface HuskHomes {
|
||||
* @param playerName the name of the player to find
|
||||
* @return an {@link Optional} containing the {@link OnlineUser} if found, or an empty {@link Optional} if not found
|
||||
*/
|
||||
@NotNull
|
||||
default Optional<OnlineUser> findPlayer(@NotNull String playerName) {
|
||||
return Optional.ofNullable(getOnlinePlayers().stream()
|
||||
return getOnlinePlayers().stream()
|
||||
.filter(user -> user.username.equalsIgnoreCase(playerName))
|
||||
.findFirst()
|
||||
.orElse(getOnlinePlayers().stream()
|
||||
.or(() -> getOnlinePlayers().stream()
|
||||
.filter(user -> user.username.toLowerCase().startsWith(playerName.toLowerCase()))
|
||||
.findFirst().orElse(null)));
|
||||
.findFirst());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user