Class CommandLoader


  • public final class CommandLoader
    extends Loader
    CommandLoader is used for creating bukkit standard commands by loading class who contains methods annotated with Command Each methods annotated with Command can have a method annotated with Completer who will be set as TabCompleter of the command
    • Constructor Summary

      Constructors 
      Constructor Description
      CommandLoader​(@NotNull org.bukkit.plugin.Plugin plugin)
      Constructor used for initialization and also getting the CommandMap instance in Bukkit.getPluginManager()
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> T load​(T obj)
      Create a new PluginCommand for all the methods annotated with Command and register this command into Bukkit CommandMap
      • Methods inherited from class net.frozenspace.frostlib.data.Loader

        load
      • Methods inherited from class java.lang.Object

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

      • CommandLoader

        public CommandLoader​(@NotNull
                             @NotNull org.bukkit.plugin.Plugin plugin)
        Constructor used for initialization and also getting the CommandMap instance in Bukkit.getPluginManager()
        Parameters:
        plugin - Plugin instance of your plugin
    • Method Detail

      • load

        @NotNull
        public <T> T load​(@NotNull
                          T obj)
        Create a new PluginCommand for all the methods annotated with Command and register this command into Bukkit CommandMap
        Specified by:
        load in class Loader
        Type Parameters:
        T - Type of the object to load
        Parameters:
        obj - Instance of the object to load
        Returns:
        The object passed as parameter