本文整理汇总了Java中ch.njol.skript.Skript.outdatedError方法的典型用法代码示例。如果您正苦于以下问题:Java Skript.outdatedError方法的具体用法?Java Skript.outdatedError怎么用?Java Skript.outdatedError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ch.njol.skript.Skript
的用法示例。
在下文中一共展示了Skript.outdatedError方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupBukkitCommand
import ch.njol.skript.Skript; //导入方法依赖的package包/类
private PluginCommand setupBukkitCommand() {
try {
final Constructor<PluginCommand> c = PluginCommand.class.getDeclaredConstructor(String.class, Plugin.class);
c.setAccessible(true);
final PluginCommand bukkitCommand = c.newInstance(name, Skript.getInstance());
bukkitCommand.setAliases(aliases);
bukkitCommand.setDescription(description);
bukkitCommand.setLabel(label);
bukkitCommand.setPermission(permission);
bukkitCommand.setPermissionMessage(permissionMessage);
bukkitCommand.setUsage(usage);
bukkitCommand.setExecutor(this);
return bukkitCommand;
} catch (final Exception e) {
Skript.outdatedError(e);
throw new EmptyStacktraceException();
}
}
示例2: registerHelp
import ch.njol.skript.Skript; //导入方法依赖的package包/类
public void registerHelp() {
helps.clear();
final HelpMap help = Bukkit.getHelpMap();
final HelpTopic t = new GenericCommandHelpTopic(bukkitCommand);
help.addTopic(t);
helps.add(t);
final HelpTopic aliases = help.getHelpTopic("Aliases");
if (aliases != null && aliases instanceof IndexHelpTopic) {
aliases.getFullText(Bukkit.getConsoleSender()); // CraftBukkit has a lazy IndexHelpTopic class (org.bukkit.craftbukkit.help.CustomIndexHelpTopic) - maybe its used for aliases as well
try {
final Field topics = IndexHelpTopic.class.getDeclaredField("allTopics");
topics.setAccessible(true);
@SuppressWarnings("unchecked")
final ArrayList<HelpTopic> as = new ArrayList<HelpTopic>((Collection<HelpTopic>) topics.get(aliases));
for (final String alias : activeAliases) {
final HelpTopic at = new CommandAliasHelpTopic("/" + alias, "/" + getLabel(), help);
as.add(at);
helps.add(at);
}
Collections.sort(as, HelpTopicComparator.helpTopicComparatorInstance());
topics.set(aliases, as);
} catch (final Exception e) {
Skript.outdatedError(e);//, "error registering aliases for /" + getName());
}
}
}
示例3: unregisterHelp
import ch.njol.skript.Skript; //导入方法依赖的package包/类
public void unregisterHelp() {
Bukkit.getHelpMap().getHelpTopics().removeAll(helps);
final HelpTopic aliases = Bukkit.getHelpMap().getHelpTopic("Aliases");
if (aliases != null && aliases instanceof IndexHelpTopic) {
try {
final Field topics = IndexHelpTopic.class.getDeclaredField("allTopics");
topics.setAccessible(true);
@SuppressWarnings("unchecked")
final ArrayList<HelpTopic> as = new ArrayList<HelpTopic>((Collection<HelpTopic>) topics.get(aliases));
as.removeAll(helps);
topics.set(aliases, as);
} catch (final Exception e) {
Skript.outdatedError(e);//, "error unregistering aliases for /" + getName());
}
}
helps.clear();
}