17
17
18
18
package me .despical .commandframework ;
19
19
20
+ import me .despical .commandframework .utils .Utils ;
20
21
import org .bukkit .ChatColor ;
21
22
import org .bukkit .command .*;
22
23
import org .bukkit .entity .Player ;
@@ -142,9 +143,9 @@ public void registerCommands(@NotNull Object instance) {
142
143
final Completer completer = method .getAnnotation (Completer .class );
143
144
144
145
if (completer .name ().contains ("." )) {
145
- subCommandCompletions .put (completer , me . despical . commons . util . Collections .mapEntry (method , instance ));
146
+ subCommandCompletions .put (completer , Utils .mapEntry (method , instance ));
146
147
} else {
147
- commandCompletions .put (completer , me . despical . commons . util . Collections .mapEntry (method , instance ));
148
+ commandCompletions .put (completer , Utils .mapEntry (method , instance ));
148
149
}
149
150
}
150
151
}
@@ -161,9 +162,9 @@ private void registerCommand(Command command, Method method, Object instance) {
161
162
final String cmdName = command .name ();
162
163
163
164
if (cmdName .contains ("." )) {
164
- subCommands .put (command , me . despical . commons . util . Collections .mapEntry (method , instance ));
165
+ subCommands .put (command , Utils .mapEntry (method , instance ));
165
166
} else {
166
- commands .put (command , me . despical . commons . util . Collections .mapEntry (method , instance ));
167
+ commands .put (command , Utils .mapEntry (method , instance ));
167
168
168
169
try {
169
170
final Constructor <PluginCommand > constructor = PluginCommand .class .getDeclaredConstructor (String .class , Plugin .class );
@@ -200,7 +201,7 @@ private Map.Entry<Command, Map.Entry<Method, Object>> getAssociatedCommand(@NotN
200
201
201
202
// If we found the sub command then return it, otherwise search the commands map
202
203
if (command != null ) {
203
- return me . despical . commons . util . Collections .mapEntry (command , subCommands .get (command ));
204
+ return Utils .mapEntry (command , subCommands .get (command ));
204
205
}
205
206
206
207
// If our command is not a sub command then search for a main command
@@ -217,7 +218,7 @@ private Map.Entry<Command, Map.Entry<Method, Object>> getAssociatedCommand(@NotN
217
218
if (command != null ) {
218
219
// Quick fix to accept any match consumer if defined
219
220
if (command .min () >= possibleArgs .length || command .allowInfiniteArgs ()) {
220
- return me . despical . commons . util . Collections .mapEntry (command , commands .get (command ));
221
+ return Utils .mapEntry (command , commands .get (command ));
221
222
}
222
223
}
223
224
@@ -231,7 +232,7 @@ private boolean hasCooldown(final CommandSender sender, final Command command) {
231
232
final Map <Command , Long > cooldownMap = cooldowns .get (sender );
232
233
233
234
if (cooldownMap == null ) {
234
- cooldowns .put (sender , me . despical . commons . util . Collections .mapOf (command , System .currentTimeMillis ()));
235
+ cooldowns .put (sender , Utils .mapOf (command , System .currentTimeMillis ()));
235
236
return false ;
236
237
} else if (!cooldownMap .containsKey (command )) {
237
238
cooldownMap .put (command , System .currentTimeMillis ());
@@ -313,7 +314,7 @@ private Map.Entry<Completer, Map.Entry<Method, Object>> getAssociatedCompleter(@
313
314
}
314
315
315
316
if (completer != null ) {
316
- return me . despical . commons . util . Collections .mapEntry (completer , subCommandCompletions .get (completer ));
317
+ return Utils .mapEntry (completer , subCommandCompletions .get (completer ));
317
318
}
318
319
319
320
for (Completer comp : commandCompletions .keySet ()) {
@@ -326,7 +327,7 @@ private Map.Entry<Completer, Map.Entry<Method, Object>> getAssociatedCompleter(@
326
327
}
327
328
328
329
if (completer != null ) {
329
- return me . despical . commons . util . Collections .mapEntry (completer , commandCompletions .get (completer ));
330
+ return Utils .mapEntry (completer , commandCompletions .get (completer ));
330
331
}
331
332
332
333
return null ;
0 commit comments