Class PaperCommandFactory
- java.lang.Object
-
- com.github.siroshun09.mccommand.paper.PaperCommandFactory
-
public final class PaperCommandFactory extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
register(@NotNull PluginCommand target, @NotNull Command command)
Registers the command.static void
registerAsync(@NotNull PluginCommand target, @NotNull Command command)
Registers the command.static void
registerAsync(@NotNull PluginCommand target, @NotNull Command command, @NotNull Executor executor)
Registers the command.static void
registerAsyncIfExists(@NotNull JavaPlugin sourcePlugin, @NotNull Command command)
Searches forPluginCommand
that is named asCommand.getName()
and register the command if it exists.static void
registerAsyncIfExists(@NotNull JavaPlugin sourcePlugin, @NotNull Command command, @NotNull Executor executor)
Searches forPluginCommand
that is named asCommand.getName()
and register the command if it exists.static void
registerIfExists(@NotNull JavaPlugin sourcePlugin, @NotNull Command command)
Searches forPluginCommand
that is named asCommand.getName()
and register the command if it exists.
-
-
-
Method Detail
-
register
public static void register(@NotNull @NotNull PluginCommand target, @NotNull @NotNull Command command)
Registers the command.- Parameters:
target
- thePluginCommand
command
- the command to register
-
registerIfExists
public static void registerIfExists(@NotNull @NotNull JavaPlugin sourcePlugin, @NotNull @NotNull Command command)
Searches forPluginCommand
that is named asCommand.getName()
and register the command if it exists.- Parameters:
sourcePlugin
- the plugin to search for the commandcommand
- the command to register
-
registerAsync
public static void registerAsync(@NotNull @NotNull PluginCommand target, @NotNull @NotNull Command command)
Registers the command.If you register a command with this method, it will be executed asynchronously.
Note:
The tab completion will execute on main thread.
If you want the tab completion to be executed asynchronously, use
AsyncTabCompleteListener.register(Plugin, Command)
.- Parameters:
target
- thePluginCommand
command
- the command to register
-
registerAsyncIfExists
public static void registerAsyncIfExists(@NotNull @NotNull JavaPlugin sourcePlugin, @NotNull @NotNull Command command)
Searches forPluginCommand
that is named asCommand.getName()
and register the command if it exists.- Parameters:
sourcePlugin
- the plugin to search for the commandcommand
- the command to register- See Also:
registerAsync(PluginCommand, Command)
-
registerAsync
public static void registerAsync(@NotNull @NotNull PluginCommand target, @NotNull @NotNull Command command, @NotNull @NotNull Executor executor)
Registers the command.If you register a command with this method, it will be executed asynchronously.
Note:
The tab completion will execute on main thread.
If you want the tab completion to be executed asynchronously, use
AsyncTabCompleteListener.register(Plugin, Command)
.- Parameters:
target
- thePluginCommand
command
- the command to registerexecutor
- the executor to run command
-
registerAsyncIfExists
public static void registerAsyncIfExists(@NotNull @NotNull JavaPlugin sourcePlugin, @NotNull @NotNull Command command, @NotNull @NotNull Executor executor)
Searches forPluginCommand
that is named asCommand.getName()
and register the command if it exists.- Parameters:
sourcePlugin
- the plugin to search for the commandcommand
- the command to registerexecutor
- the executor to run command- See Also:
registerAsync(PluginCommand, Command)
-
-