Package com.burchard36.api.command
Class CommandInjector
java.lang.Object
com.burchard36.api.command.exceptions.CommandExceptionFactory
com.burchard36.api.command.CommandInjector
public class CommandInjector
extends com.burchard36.api.command.exceptions.CommandExceptionFactory
Injects ApiCommands into Bukkit's command map
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidInjects all commands into the BukkitCommand map Also search's for classes extendingApiCommandand auto-registers them if they haveCommandNameorRegisterCommandAnnotation(s)protected static voidregister(org.bukkit.command.Command command)Injects ApiCommand into Bukkits CommandMapstatic voidregisterCommand(ApiCommand command)Registers a single commandstatic voidregisterCommands(List<ApiCommand> commands)Registers a whole list of commands at onceMethods inherited from class com.burchard36.api.command.exceptions.CommandExceptionFactory
newClassNotTypeOfApiCommand, newCommandInvocationException, newConstructorNotFoundException, newInvalidCommandAnnotationException
-
Constructor Details
-
CommandInjector
public CommandInjector()
-
-
Method Details
-
injectCommands
public static void injectCommands()Injects all commands into the BukkitCommand map Also search's for classes extendingApiCommandand auto-registers them if they haveCommandNameorRegisterCommandAnnotation(s) -
registerCommand
Registers a single command- Parameters:
command- Command extending ApiCommand
-
registerCommands
Registers a whole list of commands at once- Parameters:
commands- List of classes extending ApiCommand
-
register
protected static void register(org.bukkit.command.Command command)Injects ApiCommand into Bukkits CommandMap- Parameters:
command- Class extending BukkitCommand to inject into CommandMap
-