本文整理汇总了Java中org.bukkit.plugin.Plugin.getDescription方法的典型用法代码示例。如果您正苦于以下问题:Java Plugin.getDescription方法的具体用法?Java Plugin.getDescription怎么用?Java Plugin.getDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.plugin.Plugin
的用法示例。
在下文中一共展示了Plugin.getDescription方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: call
import org.bukkit.plugin.Plugin; //导入方法依赖的package包/类
public Object call() throws Exception {
StringWriter value = new StringWriter();
try {
value.append("\n Running: ").append(Bukkit.getName()).append(" version ").append(Bukkit.getVersion()).append(" (Implementing API version ").append(Bukkit.getBukkitVersion()).append(") ").append(String.valueOf(net.minecraft.server.MinecraftServer.getServer().isServerInOnlineMode()));
value.append("\n Plugins: {");
for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
PluginDescriptionFile description = plugin.getDescription();
value.append(' ').append(description.getFullName()).append(' ').append(description.getMain()).append(' ').append(Arrays.toString(description.getAuthors().toArray())).append(',');
}
value.append("}\n Warnings: ").append(Bukkit.getWarningState().name());
value.append("\n Threads: {");
for (Map.Entry<Thread, ? extends Object[]> entry : Thread.getAllStackTraces().entrySet()) {
value.append(' ').append(entry.getKey().getState().name()).append(' ').append(entry.getKey().getName()).append(": ").append(Arrays.toString(entry.getValue())).append(',');
}
value.append("}\n ").append(Bukkit.getScheduler().toString());
} catch (Throwable t) {
value.append("\n Failed to handle CraftCrashReport:\n");
PrintWriter writer = new PrintWriter(value);
t.printStackTrace(writer);
writer.flush();
}
return value.toString();
}
示例2: isDepend
import org.bukkit.plugin.Plugin; //导入方法依赖的package包/类
public static boolean isDepend(String superPluginName, Plugin checkPlugin) {
PluginDescriptionFile desc = checkPlugin.getDescription();
List<String> softDepend = desc.getSoftDepend();
List<String> depend = desc.getDepend();
return softDepend != null && softDepend.contains(superPluginName)
|| depend != null && depend.contains(superPluginName);
}