本文整理汇总了Java中cn.nukkit.command.SimpleCommandMap类的典型用法代码示例。如果您正苦于以下问题:Java SimpleCommandMap类的具体用法?Java SimpleCommandMap怎么用?Java SimpleCommandMap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SimpleCommandMap类属于cn.nukkit.command包,在下文中一共展示了SimpleCommandMap类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerCommands
import cn.nukkit.command.SimpleCommandMap; //导入依赖的package包/类
private void registerCommands() {
if (config.getBoolean("canUseCommands", true)) {
SimpleCommandMap map = getServer().getCommandMap();
List<Command> commands = new ArrayList<>(Arrays.asList(
new TxtCommand(this)//,
//new TxtAdmCommand(this)
));
map.registerAll("Texter", commands);
String empty[] = {};
getLogger().info(TextFormat.GREEN + language.transrateString("commands.registered"));
}else {
getLogger().info(TextFormat.RED + language.transrateString("commands.unavailable"));
}
}
示例2: registerCommand
import cn.nukkit.command.SimpleCommandMap; //导入依赖的package包/类
public void registerCommand(String name, String description, String usage, String permission, String[] aliases) {
SimpleCommandMap map = this.getServer().getCommandMap();
@SuppressWarnings({ "unchecked", "rawtypes" })
PluginCommand cmd = new PluginCommand(name, this);
cmd.setDescription(description);
cmd.setUsage(usage);
cmd.setPermission(permission);
cmd.setAliases(aliases);
map.register(name, cmd);
}
示例3: registerCommand
import cn.nukkit.command.SimpleCommandMap; //导入依赖的package包/类
public void registerCommand(String name, String description, String usage, String permission) {
SimpleCommandMap commandMap = this.plugin.getServer().getCommandMap();
PluginCommand<Main> command = new PluginCommand<Main>(name, plugin);
command.setDescription(description);
command.setUsage(usage);
command.setPermission(permission);
commandMap.register(name, command);
}
示例4: registerCommand
import cn.nukkit.command.SimpleCommandMap; //导入依赖的package包/类
public void registerCommand(String name, String description, String usage, String permission) {
SimpleCommandMap map = plugin.getServer().getCommandMap();
PluginCommand<T> cmd = new PluginCommand<T>(name, plugin);
cmd.setDescription(description);
cmd.setUsage(usage);
cmd.setPermission(permission);
map.register(name, cmd);
}
示例5: PluginManager
import cn.nukkit.command.SimpleCommandMap; //导入依赖的package包/类
public PluginManager(Server server, SimpleCommandMap commandMap) {
this.server = server;
this.commandMap = commandMap;
}
示例6: getCommandMap
import cn.nukkit.command.SimpleCommandMap; //导入依赖的package包/类
public SimpleCommandMap getCommandMap() {
return commandMap;
}
示例7: NukkitCommandManager
import cn.nukkit.command.SimpleCommandMap; //导入依赖的package包/类
public NukkitCommandManager(SimpleCommandMap map) {
this.commandMap = map;
}