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