mirror of
https://e.coding.net/circlecloud/Yum.git
synced 2024-11-22 22:38:46 +00:00
fix null error add unload info...
This commit is contained in:
parent
abfdd97a28
commit
c310706d33
@ -73,6 +73,7 @@ public class FileConfig extends YamlConfiguration {
|
||||
private void check(File file) {
|
||||
String filename = file.getName();
|
||||
InputStream stream = plugin.getResource(filename);
|
||||
|
||||
try {
|
||||
if (!file.exists()) {
|
||||
file.getParentFile().mkdirs();
|
||||
@ -84,6 +85,9 @@ public class FileConfig extends YamlConfiguration {
|
||||
loger.info("配置文件 " + filename + " 不存在 从插件释放...");
|
||||
}
|
||||
} else {
|
||||
if (stream == null) {
|
||||
return;
|
||||
}
|
||||
FileConfig newcfg = new FileConfig(stream);
|
||||
FileConfig oldcfg = new FileConfig(file);
|
||||
String newver = newcfg.getString("version");
|
||||
|
@ -454,7 +454,7 @@ public class PluginsManager {
|
||||
if (command.getPlugin() == next) {
|
||||
command.unregister(commandMap);
|
||||
it.remove();
|
||||
sender.sendMessage("§6卸载: §a插件: " + name + " 的命令!");
|
||||
sender.sendMessage("§6卸载: §a插件 " + name + " 的 " + command.getDescription() + " 命令已卸载!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -467,7 +467,7 @@ public class PluginsManager {
|
||||
RegisteredListener value = it.next();
|
||||
if (value.getPlugin().getName().equals(name)) {
|
||||
it.remove();
|
||||
sender.sendMessage("§6卸载: §a插件: " + name + " 的监听器!");
|
||||
sender.sendMessage("§6卸载: §a插件 " + name + " 的 " + value.getListener().getClass() + " 监听器已卸载!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -476,11 +476,11 @@ public class PluginsManager {
|
||||
if ((cl instanceof URLClassLoader)) {
|
||||
try {
|
||||
((URLClassLoader) cl).close();
|
||||
sender.sendMessage("§6卸载: §a插件: " + name + " 的类加载器!");
|
||||
sender.sendMessage("§6卸载: §a插件 " + name + " 类加载器已卸载!");
|
||||
} catch (IOException ex) {
|
||||
}
|
||||
}
|
||||
sender.sendMessage("§6卸载: §a插件: " + name + " 已成功卸载!");
|
||||
sender.sendMessage("§6卸载: §a插件 " + name + " 已成功卸载!");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user