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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Injects all commands into the BukkitCommand map Also search's for classes extending ApiCommand and auto-registers them if they have CommandName or RegisterCommand Annotation(s)
    protected static void
    register​(org.bukkit.command.Command command)
    Injects ApiCommand into Bukkits CommandMap
    static void
    Registers a single command
    static void
    Registers a whole list of commands at once

    Methods inherited from class com.burchard36.api.command.exceptions.CommandExceptionFactory

    newClassNotTypeOfApiCommand, newCommandInvocationException, newConstructorNotFoundException, newInvalidCommandAnnotationException

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CommandInjector

      public CommandInjector()
  • Method Details

    • injectCommands

      public static void injectCommands()
      Injects all commands into the BukkitCommand map Also search's for classes extending ApiCommand and auto-registers them if they have CommandName or RegisterCommand Annotation(s)
    • registerCommand

      public static void registerCommand(ApiCommand command)
      Registers a single command
      Parameters:
      command - Command extending ApiCommand
    • registerCommands

      public static void registerCommands(List<ApiCommand> commands)
      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