fix NullPointerException...

Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
502647092 2015-08-22 16:01:06 +08:00
parent 139b06e031
commit f3ed5ff872
3 changed files with 6 additions and 6 deletions

View File

@ -3,6 +3,7 @@
*/ */
package cn.citycraft.Yum.commands; package cn.citycraft.Yum.commands;
import org.apache.commons.lang.StringUtils;
import org.bukkit.command.CommandException; import org.bukkit.command.CommandException;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
@ -44,8 +45,8 @@ public class CommandInfo extends BaseCommand {
PluginDescriptionFile desc = plugin.getDescription(); PluginDescriptionFile desc = plugin.getDescription();
sender.sendMessage("§6插件名称: §3" + plugin.getName()); sender.sendMessage("§6插件名称: §3" + plugin.getName());
sender.sendMessage("§6插件版本: §3" + desc.getVersion()); sender.sendMessage("§6插件版本: §3" + desc.getVersion());
sender.sendMessage("§6插件作者: §3" + desc.getAuthors().toArray(new String[0]).toString()); sender.sendMessage("§6插件作者: §3" + StringUtils.join(desc.getAuthors(), " "));
sender.sendMessage("§6插件描述: §3" + desc.getDescription() == null ? "" : desc.getDescription()); sender.sendMessage("§6插件描述: §3" + (desc.getDescription() == null ? "" : desc.getDescription()));
sender.sendMessage("§6插件依赖: §3" + (desc.getDepend().size() == 0 ? "" : "")); sender.sendMessage("§6插件依赖: §3" + (desc.getDepend().size() == 0 ? "" : ""));
StringUtil.sendStringArray(sender, desc.getDepend()); StringUtil.sendStringArray(sender, desc.getDepend());
sender.sendMessage("§6插件软依赖: §3" + (desc.getSoftDepend().size() == 0 ? "" : "")); sender.sendMessage("§6插件软依赖: §3" + (desc.getSoftDepend().size() == 0 ? "" : ""));

View File

@ -23,9 +23,8 @@ public class DownloadManager {
} }
public boolean run(CommandSender sender, String pluginname) { public boolean run(CommandSender sender, String pluginname) {
// String url = String url = "http://ci.citycraft.cn:8800/jenkins/job/%1$s/lastSuccessfulBuild/artifact/target/%1$s.jar";
// "http://ci.citycraft.cn:8800/jenkins/job/%1$s/lastSuccessfulBuild/artifact/target/%1$s.jar"; // String url = "https://502647092.github.io/plugins/%1$s/%1$s.jar";
String url = "https://502647092.github.io/plugins/%1$s/%1$s.jar";
BufferedInputStream in = null; BufferedInputStream in = null;
FileOutputStream fout = null; FileOutputStream fout = null;
if (sender == null) { if (sender == null) {

View File

@ -156,7 +156,7 @@ public class PluginsManager {
return false; return false;
} }
private static String load(Plugin plugin) { public static String load(Plugin plugin) {
return load(plugin.getName()); return load(plugin.getName());
} }