7
7
import com .datasiqn .commandcore .command .Command ;
8
8
import com .datasiqn .commandcore .command .CommandContext ;
9
9
import com .datasiqn .commandcore .command .TabComplete ;
10
+ import com .datasiqn .commandcore .command .builder .CommandLink .Executor ;
11
+ import com .datasiqn .commandcore .command .builder .CommandLink .Requirement ;
10
12
import com .datasiqn .resultapi .None ;
11
13
import com .datasiqn .resultapi .Result ;
12
14
import org .bukkit .ChatColor ;
17
19
import java .util .ArrayList ;
18
20
import java .util .Collections ;
19
21
import java .util .List ;
20
- import java .util .Set ;
21
- import java .util .function .Consumer ;
22
22
23
23
class BuilderCommand implements Command {
24
24
private final String name ;
@@ -27,9 +27,9 @@ class BuilderCommand implements Command {
27
27
private final String permission ;
28
28
private final List <String > usages ;
29
29
30
- private final Set <CommandNode <?>> nodes ;
31
- private final Consumer < CommandContext > executor ;
32
- private final List <CommandLink . Requirement > requires ;
30
+ private final List <CommandNode <?>> nodes ;
31
+ private final Executor executor ;
32
+ private final List <Requirement > requires ;
33
33
34
34
public BuilderCommand (@ NotNull CommandBuilder commandBuilder , List <String > usages ) {
35
35
this .name = commandBuilder .name ;
@@ -102,7 +102,7 @@ public BuilderCommand(@NotNull CommandBuilder commandBuilder, List<String> usage
102
102
if (args .size () >= 1 ) {
103
103
ArgumentReader reader = args .asReader ();
104
104
CommandContext newContext = context ;
105
- Set <CommandNode <?>> nodeSet = nodes ;
105
+ List <CommandNode <?>> nodeSet = nodes ;
106
106
107
107
String matchingString = args .getString (args .size () - 1 );
108
108
@@ -155,7 +155,7 @@ public boolean hasDescription() {
155
155
return CommandCore .createContext (context .getSource (), context .getCommand (), context .getLabel (), new StringArguments (result .args ));
156
156
}
157
157
158
- private @ NotNull Result <ApplicableNode , List <String >> checkApplicable (@ NotNull ArgumentReader reader , @ NotNull Set <CommandNode <?>> nodes ) {
158
+ private @ NotNull Result <ApplicableNode , List <String >> checkApplicable (@ NotNull ArgumentReader reader , @ NotNull List <CommandNode <?>> nodes ) {
159
159
List <CommandNode <?>> options = new ArrayList <>();
160
160
List <String > exceptions = new ArrayList <>();
161
161
if (reader .index () != 0 && !reader .atEnd ()) reader .next ();
@@ -177,7 +177,7 @@ public boolean hasDescription() {
177
177
178
178
@ Contract ("_ -> new" )
179
179
private @ NotNull CurrentNode findCurrentNode (@ NotNull ArgumentReader reader ) {
180
- Set <CommandNode <?>> nodeSet = nodes ;
180
+ List <CommandNode <?>> nodeSet = nodes ;
181
181
List <String > args = new ArrayList <>();
182
182
List <CommandNode <?>> nodeList = new ArrayList <>();
183
183
CommandNode <?> node ;
0 commit comments