Class CommandReflection

java.lang.Object
me.tippie.tippieutils.v1_2_0.reflection.CommandReflection

public class CommandReflection extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static @NotNull org.bukkit.command.PluginCommand
    getCommand​(@NotNull String name, @NotNull org.bukkit.plugin.Plugin plugin)
    Get a PluginCommand without it being registered in the plugin.yml, this will auto register by default
    static @NotNull org.bukkit.command.PluginCommand
    getCommand​(@NotNull String name, @NotNull org.bukkit.plugin.Plugin plugin, boolean autoRegister)
    Get a PluginCommand without it being registered in the plugin.yml
    static @NotNull org.bukkit.command.CommandMap
    Gets the command map of Bukkit using reflection.

    Methods inherited from class java.lang.Object

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

    • CommandReflection

      public CommandReflection()
  • Method Details

    • getCommandMap

      @NotNull public static @NotNull org.bukkit.command.CommandMap getCommandMap() throws CommandMapException
      Gets the command map of Bukkit using reflection.
      Returns:
      Bukkit's command map
      Throws:
      CommandMapException - when there is an error getting the command map
    • getCommand

      @NotNull public static @NotNull org.bukkit.command.PluginCommand getCommand(@NotNull @NotNull String name, @NotNull @NotNull org.bukkit.plugin.Plugin plugin) throws PluginCommandException
      Get a PluginCommand without it being registered in the plugin.yml, this will auto register by default
      Parameters:
      name - The name of the command
      plugin - The plugin it belongs to.
      Returns:
      The created and registered command
      Throws:
      PluginCommandException - when there is an error creating the command.
    • getCommand

      @NotNull public static @NotNull org.bukkit.command.PluginCommand getCommand(@NotNull @NotNull String name, @NotNull @NotNull org.bukkit.plugin.Plugin plugin, boolean autoRegister) throws PluginCommandException
      Get a PluginCommand without it being registered in the plugin.yml
      Parameters:
      name - The name of the command
      plugin - The plugin it belongs to.
      autoRegister - Whether to automatically register the command.
      Returns:
      The created command
      Throws:
      PluginCommandException - when there is an error creating the command.