File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
src/main/java/com/datasiqn/commandcore/argument/type Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 1
1
package com .datasiqn .commandcore .argument .type ;
2
2
3
+ import com .datasiqn .commandcore .command .CommandContext ;
3
4
import com .datasiqn .resultapi .None ;
4
5
import com .datasiqn .resultapi .Result ;
5
6
import org .bukkit .Bukkit ;
6
7
import org .bukkit .entity .Player ;
7
8
import org .jetbrains .annotations .NotNull ;
8
9
10
+ import java .util .List ;
11
+ import java .util .stream .Collectors ;
12
+
9
13
class PlayerArgumentType implements SimpleArgumentType <Player > {
10
14
@ Override
11
15
public @ NotNull String getTypeName () {
@@ -16,4 +20,9 @@ class PlayerArgumentType implements SimpleArgumentType<Player> {
16
20
public @ NotNull Result <Player , None > parseWord (String word ) {
17
21
return Result .ofNullable (Bukkit .getPlayerExact (word ), None .NONE );
18
22
}
23
+
24
+ @ Override
25
+ public @ NotNull List <String > getTabComplete (@ NotNull CommandContext context ) {
26
+ return Bukkit .getOnlinePlayers ().stream ().map (Player ::getName ).collect (Collectors .toList ());
27
+ }
19
28
}
You can’t perform that action at this time.
0 commit comments