mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-25 06:24:43 +00:00
Should load from whatever minecraft comes from now...
This commit is contained in:
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();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user