public static IMod loadMod(File jar) {
		try {
			URLClassLoader classLoader = URLClassLoader.newInstance(new URL[] {jar.toURI().toURL()});
			@SuppressWarnings("resource")
			JarFile jarFile = new JarFile(jar);
			Enumeration<JarEntry> entries = jarFile.entries();
			IMod mainClass = null;
			while (entries.hasMoreElements()) {
				JarEntry element = entries.nextElement();
				if (element.getName().endsWith(".class")) {
					@SuppressWarnings("rawtypes")
					Class clazz = classLoader.loadClass(element.getName().replaceAll(".class", "").replaceAll("/", "."));
					try {
						Object obj = clazz.newInstance();
						if (obj instanceof IMod) {
						mainClass = (IMod) obj;
						}
					} catch (InstantiationException e) {
					}
				}
			}
			return mainClass;
		} catch(MalformedURLException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		}
		return null;
	}