本文整理匯總了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);
}