Package pers.neige.neigeitems.utils
Class CommandUtils
-
- All Implemented Interfaces:
public class CommandUtils
-
-
Field Summary
Fields Modifier and Type Field Description public static SimpleCommandMap
commandMap
public static Map<String, Command>
knownCommands
-
Constructor Summary
Constructors Constructor Description CommandUtils()
-
Method Summary
Modifier and Type Method Description static SimpleCommandMap
getCommandMap()
获取 SimpleCommandMap. static Map<String, Command>
getKnownCommands()
获取所有已注册指令. static PluginCommand
newPluginCommand(@NonNull() String name, @NonNull() Plugin owner)
新建一个 PluginCommand 对象. static void
unregisterCommand(String command)
卸载指令. static void
setPlugin(PluginCommand command, Plugin plugin)
设置指令拥有者. -
-
Method Detail
-
getCommandMap
@NonNull() static SimpleCommandMap getCommandMap()
获取 SimpleCommandMap.
- Returns:
SimpleCommandMap.
-
getKnownCommands
@NonNull() static Map<String, Command> getKnownCommands()
获取所有已注册指令.
- Returns:
所有已注册指令.
-
newPluginCommand
@Nullable() static PluginCommand newPluginCommand(@NonNull() String name, @NonNull() Plugin owner)
新建一个 PluginCommand 对象.
- Parameters:
name
- 指令名.owner
- 创建指令的插件.- Returns:
对应的 PluginCommand 对象.
-
unregisterCommand
static void unregisterCommand(String command)
卸载指令.
- Parameters:
command
- 待卸载指令.
-
setPlugin
static void setPlugin(PluginCommand command, Plugin plugin)
设置指令拥有者.
- Parameters:
command
- 待设置指令.
-
-
-
-