修改部分方案 增强稳定性...

Signed-off-by: 502647092 <jtb1@163.com>
dev 1.8.7
502647092 2015-11-29 15:20:34 +08:00
parent 78a73e3e40
commit c28bf9742a
3 changed files with 11 additions and 13 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>cn.citycraft</groupId>
<artifactId>Yum</artifactId>
<version>1.8.6</version>
<version>1.8.7</version>
<name>Yum</name>
<description>Minecraft 服务器插件管理系统</description>
<build>
@ -55,7 +55,7 @@
</build>
<properties>
<jenkins.url>http://ci.citycraft.cn:8080</jenkins.url>
<update.description>&amp;c新增只允许控制台执行选项...</update.description>
<update.description>&amp;c修改部分方案 增强稳定性...</update.description>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>

View File

@ -21,9 +21,6 @@ import cn.citycraft.Yum.api.YumAPI;
public class CommandDelete extends BaseCommand {
Yum main;
/**
* @param name
*/
public CommandDelete(final Yum main) {
super("remove");
this.main = main;
@ -37,8 +34,9 @@ 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();
if (YumAPI.getPlugman().deletePlugin(sender, plugin)) {
sender.sendMessage("§c删除: §a插件 " + pluginname + " 已从服务器卸载并删除!");
sender.sendMessage("§c删除: §a插件 §6" + pluginname + " §a版本 §d" + version + " §a已从服务器卸载并删除!");
} else {
sender.sendMessage("§c删除: §c插件 " + pluginname + " 卸载或删除时发生错误 删除失败!");
}

View File

@ -292,7 +292,7 @@ public class PluginsManager {
target.onLoad();
Bukkit.getPluginManager().enablePlugin(target);
sender.sendMessage("§6载入: §a插件 §b" + target.getName() + " §a版本 §d" + target.getDescription().getVersion() + " 已成功载入到服务器!");
sender.sendMessage("§6载入: §a插件 §b" + target.getName() + " §a版本 §d" + target.getDescription().getVersion() + " §a已成功载入到服务器!");
return true;
}
@ -316,7 +316,7 @@ public class PluginsManager {
final File pluginDir = new File("plugins");
final File updateDir = new File(pluginDir, "update");
if (!pluginDir.isDirectory()) {
sender.sendMessage(c插件目录不存在或IO错误!");
sender.sendMessage(6载入: §c插件目录不存在或IO错误!");
return false;
}
@ -337,7 +337,7 @@ public class PluginsManager {
}
}
if (pluginFile == null) {
sender.sendMessage("§6载入: §c在插件目录和更新目录均未找到 " + name + " 插件 请确认文件是否存在!");
sender.sendMessage("§6载入: §c在插件目录和更新目录均未找到 §b" + name + " §c插件 请确认文件是否存在!");
return false;
}
}
@ -484,7 +484,7 @@ public class PluginsManager {
knownCommandsField.setAccessible(true);
knownCommands = (Map<String, Command>) knownCommandsField.get(commandMap);
} catch (final Exception e) {
sender.sendMessage("§4异常: §c" + e.getMessage() + " 插件 " + name + " 卸载失败!");
sender.sendMessage("§4异常: §c" + e.getMessage() + " 插件 §b" + name + " §c卸载失败!");
return false;
}
String pluginVersion = "";
@ -494,12 +494,12 @@ public class PluginsManager {
if ((plugins != null) && (plugins.contains(next))) {
pluginVersion = next.getDescription().getVersion();
plugins.remove(next);
sender.sendMessage("§6卸载: §a从服务器插件列表删除 " + name + " 的实例!");
sender.sendMessage("§6卸载: §a从服务器插件列表删除 §b" + name + " §a的实例!");
}
if ((lookupNames != null) && (lookupNames.containsKey(name))) {
lookupNames.remove(name);
sender.sendMessage("§6卸载: §a从插件查找列表删除 " + name + " 的实例!");
sender.sendMessage("§6卸载: §a从插件查找列表删除 §b" + name + " §a的实例!");
}
if (commandMap != null) {
@ -523,7 +523,7 @@ public class PluginsManager {
System.gc();
}
}
sender.sendMessage("§6卸载: §a插件 §b" + name + " §a版本 §d" + pluginVersion + " 已成功卸载!");
sender.sendMessage("§6卸载: §a插件 §b" + name + " §a版本 §d" + pluginVersion + " §a已成功卸载!");
return true;
}