refactor ig
This commit is contained in:
parent
ef32f9dbc4
commit
336ac4cad5
54 changed files with 528 additions and 444 deletions
|
|
@ -0,0 +1,24 @@
|
|||
package de.kentoj.kencommandapi.suggestionprovider;
|
||||
|
||||
import com.velocitypowered.api.command.CommandSource;
|
||||
import com.velocitypowered.api.proxy.Player;
|
||||
import com.velocitypowered.api.proxy.ProxyServer;
|
||||
import de.kentoj.kencommandapi.api.suggestion.SuggestionProvider;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public final class PlayerSuggestionProvider implements SuggestionProvider<CommandSource> {
|
||||
|
||||
private final ProxyServer proxyServer;
|
||||
|
||||
public PlayerSuggestionProvider(ProxyServer proxyServer) {
|
||||
this.proxyServer = proxyServer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> suggest(CommandSource __) {
|
||||
return proxyServer.getAllPlayers().stream()
|
||||
.map(Player::getUsername)
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue