From 43799a0b24bb4689dc518527ba89b3b20a1d782f Mon Sep 17 00:00:00 2001 From: 502647092 Date: Wed, 17 Feb 2016 00:47:23 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96=E6=8F=92=E4=BB=B6=E7=89=88?= =?UTF-8?q?=E6=9C=AC...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 502647092 --- .../java/cn/citycraft/Yum/commands/CommandDelete.java | 2 +- .../java/cn/citycraft/Yum/commands/CommandFullDelete.java | 2 +- src/main/java/cn/citycraft/Yum/commands/CommandInfo.java | 2 +- .../java/cn/citycraft/Yum/manager/DownloadManager.java | 2 +- .../java/cn/citycraft/Yum/manager/PluginsManager.java | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/cn/citycraft/Yum/commands/CommandDelete.java b/src/main/java/cn/citycraft/Yum/commands/CommandDelete.java index c0f4f80..082a56c 100644 --- a/src/main/java/cn/citycraft/Yum/commands/CommandDelete.java +++ b/src/main/java/cn/citycraft/Yum/commands/CommandDelete.java @@ -35,7 +35,7 @@ public class CommandDelete extends BaseCommand { final String pluginname = args[0]; final Plugin plugin = Bukkit.getServer().getPluginManager().getPlugin(pluginname); if (plugin != null) { - final String version = plugin.getDescription().getVersion(); + final String version = plugin.getDescription().getVersion().substring(0, 15); if (YumAPI.getPlugman().deletePlugin(sender, plugin)) { sender.sendMessage("§c删除: §a插件 §6" + pluginname + " §a版本 §d" + version + " §a已从服务器卸载并删除!"); } else { diff --git a/src/main/java/cn/citycraft/Yum/commands/CommandFullDelete.java b/src/main/java/cn/citycraft/Yum/commands/CommandFullDelete.java index b2f285a..258c432 100644 --- a/src/main/java/cn/citycraft/Yum/commands/CommandFullDelete.java +++ b/src/main/java/cn/citycraft/Yum/commands/CommandFullDelete.java @@ -35,7 +35,7 @@ public class CommandFullDelete extends BaseCommand { final String pluginname = args[0]; final Plugin plugin = Bukkit.getServer().getPluginManager().getPlugin(pluginname); if (plugin != null) { - final String version = plugin.getDescription().getVersion(); + final String version = plugin.getDescription().getVersion().substring(0, 15); if (YumAPI.getPlugman().fullDeletePlugin(sender, plugin)) { sender.sendMessage("§c删除: §a插件 §6" + pluginname + " §a版本 §d" + version + " §a已从服务器卸载并删除!"); } else { diff --git a/src/main/java/cn/citycraft/Yum/commands/CommandInfo.java b/src/main/java/cn/citycraft/Yum/commands/CommandInfo.java index 6bbac4b..2573a5c 100644 --- a/src/main/java/cn/citycraft/Yum/commands/CommandInfo.java +++ b/src/main/java/cn/citycraft/Yum/commands/CommandInfo.java @@ -47,7 +47,7 @@ public class CommandInfo extends BaseCommand { if (plugin != null) { final PluginDescriptionFile desc = plugin.getDescription(); sender.sendMessage("§6插件名称: §3" + plugin.getName()); - sender.sendMessage("§6插件版本: §3" + desc.getVersion()); + sender.sendMessage("§6插件版本: §3" + desc.getVersion().substring(0, 15)); sender.sendMessage("§6插件作者: §3" + StringUtils.join(desc.getAuthors(), " ")); sender.sendMessage("§6插件描述: §3" + (desc.getDescription() == null ? "无" : desc.getDescription())); sender.sendMessage("§6插件依赖: §3" + (desc.getDepend().isEmpty() ? "无" : "")); diff --git a/src/main/java/cn/citycraft/Yum/manager/DownloadManager.java b/src/main/java/cn/citycraft/Yum/manager/DownloadManager.java index 4c6652c..c7cc8bf 100644 --- a/src/main/java/cn/citycraft/Yum/manager/DownloadManager.java +++ b/src/main/java/cn/citycraft/Yum/manager/DownloadManager.java @@ -138,7 +138,7 @@ public class DownloadManager { String pVer = null; try { final PluginDescriptionFile desc = plugin.getPluginLoader().getPluginDescription(file); - pVer = desc.getVersion(); + pVer = desc.getVersion().substring(0, 15); } catch (final Exception e) { pVer = ""; } diff --git a/src/main/java/cn/citycraft/Yum/manager/PluginsManager.java b/src/main/java/cn/citycraft/Yum/manager/PluginsManager.java index 637915d..77d0c5a 100644 --- a/src/main/java/cn/citycraft/Yum/manager/PluginsManager.java +++ b/src/main/java/cn/citycraft/Yum/manager/PluginsManager.java @@ -166,7 +166,7 @@ public class PluginsManager { final ChatColor color = plugin.isEnabled() ? ChatColor.GREEN : ChatColor.RED; String pluginName = color + plugin.getName(); if (includeVersions) { - pluginName = pluginName + " (" + plugin.getDescription().getVersion() + ")"; + pluginName = pluginName + " (" + plugin.getDescription().getVersion().substring(0, 15) + ")"; } return pluginName; } @@ -233,7 +233,7 @@ public class PluginsManager { public String getPluginVersion(final String name) { final Plugin plugin = getPluginByName(name); if ((plugin != null) && (plugin.getDescription() != null)) { - return plugin.getDescription().getVersion(); + return plugin.getDescription().getVersion().substring(0, 15); } return null; } @@ -330,7 +330,7 @@ public class PluginsManager { } target.onLoad(); Bukkit.getPluginManager().enablePlugin(target); - sender.sendMessage("§6载入: §a插件 §b" + target.getName() + " §a版本 §d" + target.getDescription().getVersion() + " §a已成功载入到服务器!"); + sender.sendMessage("§6载入: §a插件 §b" + target.getName() + " §a版本 §d" + target.getDescription().getVersion().substring(0, 15) + " §a已成功载入到服务器!"); return true; } @@ -548,7 +548,7 @@ public class PluginsManager { if (next.getName().equals(name)) { pluginManager.disablePlugin(next); if ((plugins != null) && (plugins.contains(next))) { - pluginVersion = next.getDescription().getVersion(); + pluginVersion = next.getDescription().getVersion().substring(0, 15); plugins.remove(next); sender.sendMessage("§6卸载: §a从服务器插件列表删除 §b" + name + " §a的实例!"); }