本文整理汇总了Java中org.bukkit.command.defaults.BukkitCommand类的典型用法代码示例。如果您正苦于以下问题:Java BukkitCommand类的具体用法?Java BukkitCommand怎么用?Java BukkitCommand使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BukkitCommand类属于org.bukkit.command.defaults包,在下文中一共展示了BukkitCommand类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getCommandPluginName
import org.bukkit.command.defaults.BukkitCommand; //导入依赖的package包/类
private String getCommandPluginName(Command command) {
if (command instanceof VanillaCommandWrapper) {
return "Minecraft";
}
if (command instanceof BukkitCommand || command instanceof VanillaCommand) {
return "Bukkit";
}
if (command instanceof PluginIdentifiableCommand) {
return ((PluginIdentifiableCommand)command).getPlugin().getName();
}
return null;
}
开发者ID:UraniumMC,项目名称:Uranium,代码行数:13,代码来源:SimpleHelpMap.java
示例2: commandInIgnoredPlugin
import org.bukkit.command.defaults.BukkitCommand; //导入依赖的package包/类
private boolean commandInIgnoredPlugin(Command command, Set<String> ignoredPlugins) {
if ((command instanceof BukkitCommand || command instanceof VanillaCommand) && ignoredPlugins.contains("Bukkit")) {
return true;
}
if (command instanceof PluginIdentifiableCommand && ignoredPlugins.contains(((PluginIdentifiableCommand)command).getPlugin().getName())) {
return true;
}
return false;
}
开发者ID:UraniumMC,项目名称:Uranium,代码行数:10,代码来源:SimpleHelpMap.java
示例3: registerDynamicCommand
import org.bukkit.command.defaults.BukkitCommand; //导入依赖的package包/类
private void registerDynamicCommand(String command, BukkitCommand clazz) {
try {
final Class<?> subclazz = Class.forName("org.bukkit.craftbukkit.VERSION.CraftServer".replace("VERSION", BungeeCord.getServerVersion()));
Object instance = subclazz.cast(Bukkit.getServer());
instance = BungeeCord.invokeMethodByObject(instance, "getCommandMap");
ReflectionLib.invokeMethodByObject(instance, "register", command, clazz);
} catch (final Exception ex) {
Bukkit.getLogger().log(Level.WARNING, "Cannot register dynamic command.", ex);
}
}
开发者ID:Shynixn,项目名称:BlockBall,代码行数:11,代码来源:BungeeCordCommandExecutor.java
示例4: getCommandPluginName
import org.bukkit.command.defaults.BukkitCommand; //导入依赖的package包/类
private String getCommandPluginName(Command command) {
if (command.getClass().equals(VanillaCommandWrapper.class)) {
return "Minecraft";
}
if (command.getClass().equals(BukkitCommand.class) || command.getClass().equals(VanillaCommand.class)) {
return "Bukkit";
}
if (command instanceof PluginIdentifiableCommand) {
return ((PluginIdentifiableCommand)command).getPlugin().getName();
}
return null;
}
开发者ID:Bogdan-G,项目名称:FFoKC,代码行数:13,代码来源:SimpleHelpMap.java
示例5: commandInIgnoredPlugin
import org.bukkit.command.defaults.BukkitCommand; //导入依赖的package包/类
private boolean commandInIgnoredPlugin(Command command, Set<String> ignoredPlugins) {
if ((command.getClass().equals(BukkitCommand.class) || command.getClass().equals(VanillaCommand.class)) && ignoredPlugins.contains("Bukkit")) {
return true;
}
if (command instanceof PluginIdentifiableCommand && ignoredPlugins.contains(((PluginIdentifiableCommand)command).getPlugin().getName())) {
return true;
}
return false;
}
开发者ID:Bogdan-G,项目名称:FFoKC,代码行数:10,代码来源:SimpleHelpMap.java
示例6: getCommandPluginName
import org.bukkit.command.defaults.BukkitCommand; //导入依赖的package包/类
private String getCommandPluginName(Command command) {
if (command instanceof BukkitCommand || command instanceof VanillaCommand) {
return "Bukkit";
}
if (command instanceof PluginIdentifiableCommand) {
return ((PluginIdentifiableCommand)command).getPlugin().getName();
}
return null;
}
开发者ID:AlmuraDev,项目名称:Almura-Server,代码行数:10,代码来源:SimpleHelpMap.java
示例7: registerDynamicCommand
import org.bukkit.command.defaults.BukkitCommand; //导入依赖的package包/类
public static void registerDynamicCommand(String command, BukkitCommand clazz) {
Object obj = ReflectionLib.getClassFromName("org.bukkit.craftbukkit.VERSION.CraftServer").cast(Bukkit.getServer());
obj = ReflectionLib.invokeMethodByObject(obj, "getCommandMap");
ReflectionLib.invokeMethodByObject(obj, "register", command, clazz);
}
开发者ID:Shynixn,项目名称:BlockBall,代码行数:6,代码来源:NMSRegistry.java
注:本文中的org.bukkit.command.defaults.BukkitCommand类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论