Class CommandReflection
java.lang.Object
me.tippie.tippieutils.v1_2_0.reflection.CommandReflection
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull org.bukkit.command.PluginCommandgetCommand(@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 defaultstatic @NotNull org.bukkit.command.PluginCommandgetCommand(@NotNull String name, @NotNull org.bukkit.plugin.Plugin plugin, boolean autoRegister)Get a PluginCommand without it being registered in the plugin.ymlstatic @NotNull org.bukkit.command.CommandMapGets the command map of Bukkit using reflection.
-
Constructor Details
-
CommandReflection
public CommandReflection()
-
-
Method Details
-
getCommandMap
@NotNull public static @NotNull org.bukkit.command.CommandMap getCommandMap() throws CommandMapExceptionGets 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 PluginCommandExceptionGet a PluginCommand without it being registered in the plugin.yml, this will auto register by default- Parameters:
name- The name of the commandplugin- 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 PluginCommandExceptionGet a PluginCommand without it being registered in the plugin.yml- Parameters:
name- The name of the commandplugin- 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.
-