Should load from whatever minecraft comes from now...

This commit is contained in:
Christian Weeks committed 2012-04-06 09:59:58 -04:00
1 parent 51203e49f9
commit 4f97aedbb2
2 files changed
+33 -7

No files matched your search

@@ -15,6 +15,7 @@ package cpw.mods.fml.common;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLClassLoader;
@@ -38,4 +39,22 @@ public class ModClassLoader extends URLClassLoader
URL url = modFile.toURI().toURL();
super.addURL(url);
}
public File getParentSource() {
ClassLoader cl=getParent();
if (cl instanceof URLClassLoader) {
URLClassLoader ucl=(URLClassLoader) cl;
URL pUrl=ucl.getURLs()[0];
try
{
return new File(pUrl.toURI());
}
catch (URISyntaxException e)
{
// NOOP
}
}
Loader.log.severe("Unable to process our input to locate the minecraft code");
throw new LoaderException();
}
}