@@ -68,7 +68,7 @@ public void list() {
68
68
}
69
69
}
70
70
71
- commands .registerCommand ("foo" , FooCommand .class , () -> new FooCommand ());
71
+ commands .addCommand ("foo" , FooCommand .class , () -> new FooCommand ());
72
72
commands .run (server .addPlayer (), "foo" , "get" );
73
73
Assert .assertArrayEquals (new boolean [] {false , true , false }, ran );
74
74
}
@@ -83,7 +83,7 @@ public void add(String arg) {
83
83
}
84
84
}
85
85
86
- commands .registerCommand ("foo" , FooCommand .class , () -> new FooCommand ());
86
+ commands .addCommand ("foo" , FooCommand .class , () -> new FooCommand ());
87
87
commands .run (server .addPlayer (), "foo" , "add" , "pomf" );
88
88
Assert .assertArrayEquals (new String [] {"pomf" }, argValue );
89
89
}
@@ -98,7 +98,7 @@ public void add(Integer arg) {
98
98
}
99
99
}
100
100
101
- commands .registerCommand ("foo" , FooCommand .class , () -> new FooCommand ());
101
+ commands .addCommand ("foo" , FooCommand .class , () -> new FooCommand ());
102
102
commands .run (server .addPlayer (), "foo" , "add" , "42" );
103
103
Assert .assertArrayEquals (new int [] {42 }, argValue );
104
104
}
@@ -113,7 +113,7 @@ public void add(FooEnum arg) {
113
113
}
114
114
}
115
115
116
- commands .registerCommand ("foo" , FooCommand .class , () -> new FooCommand ());
116
+ commands .addCommand ("foo" , FooCommand .class , () -> new FooCommand ());
117
117
commands .run (server .addPlayer (), "foo" , "add" , "foo" );
118
118
Assert .assertArrayEquals (new FooEnum [] {FooEnum .FOO }, argValue );
119
119
commands .run (server .addPlayer (), "foo" , "add" , "bar" );
@@ -131,7 +131,7 @@ public void add(@Sender CommandSender sender) {
131
131
}
132
132
}
133
133
134
- commands .registerCommand ("foo" , FooCommand .class , () -> new FooCommand ());
134
+ commands .addCommand ("foo" , FooCommand .class , () -> new FooCommand ());
135
135
commands .run (player , "foo" , "add" );
136
136
Assert .assertArrayEquals (new CommandSender [] {player }, senders );
137
137
}
@@ -155,9 +155,8 @@ public void add() {
155
155
}
156
156
}
157
157
158
- Player player = server .addPlayer ();
159
- commands .registerCommand ("foo" , FooCommand .class , () -> new FooCommand ());
160
- commands .run (player , "foo" , "sub" , "add" );
158
+ commands .addCommand ("foo" , FooCommand .class , () -> new FooCommand ());
159
+ commands .run (server .addPlayer (), "foo" , "sub" , "add" );
161
160
Assert .assertArrayEquals (new boolean [] {true }, ran );
162
161
}
163
162
0 commit comments