File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/commands/aef
AnarchyExploitFixesLegacy/src/main/java/me/xginko/aef/commands/aef Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 1818
1919import java .util .Collections ;
2020import java .util .List ;
21+ import java .util .Locale ;
22+ import java .util .stream .Collectors ;
2123import java .util .stream .Stream ;
2224
2325public class AEFCmd extends Command implements AEFCommand {
@@ -75,7 +77,9 @@ public void enable() {
7577 throws CommandException , IllegalArgumentException
7678 {
7779 if (args .length == 1 ) {
78- return tabCompletes ;
80+ return tabCompletes .stream ()
81+ .filter (cmd -> cmd .toLowerCase (Locale .ROOT ).startsWith (args [0 ].toLowerCase (Locale .ROOT )))
82+ .collect (Collectors .toList ());
7983 }
8084
8185 if (args .length > 1 ) {
@@ -84,8 +88,6 @@ public void enable() {
8488 return subCommand .tabComplete (sender , alias , args );
8589 }
8690 }
87-
88- return tabCompletes .stream ().filter (cmd -> cmd .startsWith (args [0 ])).toList ();
8991 }
9092
9193 return Collections .emptyList ();
Original file line number Diff line number Diff line change 2020import java .util .Arrays ;
2121import java .util .Collections ;
2222import java .util .List ;
23+ import java .util .Locale ;
2324import java .util .stream .Collectors ;
2425import java .util .stream .Stream ;
2526
@@ -80,7 +81,9 @@ public void enable() {
8081 throws CommandException , IllegalArgumentException
8182 {
8283 if (args .length == 1 ) {
83- return tabCompletes ;
84+ return tabCompletes .stream ()
85+ .filter (cmd -> cmd .toLowerCase (Locale .ROOT ).startsWith (args [0 ].toLowerCase (Locale .ROOT )))
86+ .collect (Collectors .toList ());
8487 }
8588
8689 if (args .length > 1 ) {
@@ -89,8 +92,6 @@ public void enable() {
8992 return subCommand .tabComplete (sender , alias , args );
9093 }
9194 }
92-
93- return tabCompletes .stream ().filter (cmd -> cmd .startsWith (args [0 ])).collect (Collectors .toList ());
9495 }
9596
9697 return Collections .emptyList ();
You can’t perform that action at this time.
0 commit comments