本文整理了Java中org.bukkit.Server.getPluginCommand()
方法的一些代码示例,展示了Server.getPluginCommand()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Server.getPluginCommand()
方法的具体详情如下:
包路径:org.bukkit.Server
类名称:Server
方法名:getPluginCommand
[英]Gets a PluginCommand with the given name or alias.
[中]获取具有给定名称或别名的PluginCommand。
代码示例来源:origin: Bukkit/Bukkit
/**
* @see Server#getPluginCommand(String name)
*/
public static PluginCommand getPluginCommand(String name) {
return server.getPluginCommand(name);
}
代码示例来源:origin: EngineHub/WorldEdit
public static boolean isFakeNijiPerms(Plugin plugin) {
PluginCommand permsCommand = Bukkit.getServer().getPluginCommand("permissions");
return permsCommand == null || !(permsCommand.getPlugin().equals(plugin));
}
代码示例来源:origin: Bukkit/Bukkit
/**
* Gets the command with the given name, specific to this plugin. Commands
* need to be registered in the {@link PluginDescriptionFile#getCommands()
* PluginDescriptionFile} to exist at runtime.
*
* @param name name or alias of the command
* @return the plugin command if found, otherwise null
*/
public PluginCommand getCommand(String name) {
String alias = name.toLowerCase();
PluginCommand command = getServer().getPluginCommand(alias);
if (command == null || command.getPlugin() != this) {
command = getServer().getPluginCommand(description.getName().toLowerCase() + ":" + alias);
}
if (command != null && command.getPlugin() == this) {
return command;
} else {
return null;
}
}
代码示例来源:origin: SpigotMC/Spigot-API
/**
* @see Server#getPluginCommand(String name)
*/
public static PluginCommand getPluginCommand(String name) {
return server.getPluginCommand(name);
}
代码示例来源:origin: SpigotMC/Spigot-API
/**
* Gets the command with the given name, specific to this plugin. Commands
* need to be registered in the {@link PluginDescriptionFile#getCommands()
* PluginDescriptionFile} to exist at runtime.
*
* @param name name or alias of the command
* @return the plugin command if found, otherwise null
*/
public PluginCommand getCommand(String name) {
String alias = name.toLowerCase();
PluginCommand command = getServer().getPluginCommand(alias);
if (command == null || command.getPlugin() != this) {
command = getServer().getPluginCommand(description.getName().toLowerCase() + ":" + alias);
}
if (command != null && command.getPlugin() == this) {
return command;
} else {
return null;
}
}
代码示例来源:origin: BigScary/GriefPrevention
Command command = Bukkit.getServer().getPluginCommand(commandName);
if(command != null)
代码示例来源:origin: Rsl1122/Plan-PlayerAnalytics
private Command getBukkitCommand(String commandName) {
Command command = plugin.getServer().getPluginCommand(commandName);
if (command == null) {
try {
command = plugin.getServer().getCommandMap().getCommand(commandName);
} catch (NoSuchMethodError ignored) {
/* Ignored, Bukkit 1.8 has no such method */
}
}
return command;
}
}
代码示例来源:origin: TotalFreedom/TotalFreedomMod
Command runCmd = server.getPluginCommand(args[0]);
if (runCmd == null)
代码示例来源:origin: TotalFreedom/TotalFreedomMod
Command command = server.getPluginCommand(cmdName);
if (command != null)
代码示例来源:origin: marcelo-mason/SimpleClans
if (!plugin.getServer().getPluginCommand(plugin.getSettingsManager().getCommandAlly()).equals(plugin.getCommand(plugin.getSettingsManager().getCommandAlly()))) {
new AllyCommandExecutor().onCommand(player, null, null, Helper.removeFirst(split));
event.setCancelled(true);
if (!plugin.getServer().getPluginCommand(plugin.getSettingsManager().getCommandGlobal()).equals(plugin.getCommand(plugin.getSettingsManager().getCommandGlobal()))) {
new GlobalCommandExecutor().onCommand(player, null, null, Helper.removeFirst(split));
event.setCancelled(true);
if (!plugin.getServer().getPluginCommand(plugin.getSettingsManager().getCommandClan()).equals(plugin.getCommand(plugin.getSettingsManager().getCommandClan()))) {
new ClanCommandExecutor().onCommand(player, null, null, Helper.removeFirst(split));
event.setCancelled(true);
if (!plugin.getServer().getPluginCommand(plugin.getSettingsManager().getCommandAccept()).equals(plugin.getCommand(plugin.getSettingsManager().getCommandAccept()))) {
new AcceptCommandExecutor().onCommand(player, null, null, Helper.removeFirst(split));
event.setCancelled(true);
if (!plugin.getServer().getPluginCommand(plugin.getSettingsManager().getCommandDeny()).equals(plugin.getCommand(plugin.getSettingsManager().getCommandDeny()))) {
new DenyCommandExecutor().onCommand(player, null, null, Helper.removeFirst(split));
event.setCancelled(true);
if (!plugin.getServer().getPluginCommand(plugin.getSettingsManager().getCommandMore()).equals(plugin.getCommand(plugin.getSettingsManager().getCommandMore()))) {
new MoreCommandExecutor().onCommand(player, null, null, Helper.removeFirst(split));
event.setCancelled(true);
内容来源于网络,如有侵权,请联系作者删除!