Created
May 28, 2015 02:55
-
-
Save mattmess1221/e20b8e7f44b49045ca38 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void loadUtils() { | |
ModContainer thisCont = FMLCommonHandler.instance().findContainerFor(this); | |
String str = Color.class.getProtectionDomain().getCodeSource().getLocation().toString(); | |
str = str.replace("/" + Color.class.getCanonicalName().replace('.', '/').concat(".class"), ""); | |
str = str.replace('\\', '/'); | |
System.out.println(str); | |
if (str.endsWith("!")) { | |
str = str.substring(0, str.length() - 1); | |
} | |
System.out.println(str); | |
if (str.startsWith("jar:")) { | |
str = str.substring(4); | |
} | |
System.out.println(str); | |
if (str.startsWith("file:/")) { | |
str = str.substring(6); | |
} | |
File source = new File(str); | |
System.out.println(source); | |
System.out.println(source.exists()); | |
ModContainer container = new InjectedModContainer(thisCont, source) { | |
@Override | |
public String getName() { | |
return "Mnm Utils"; | |
} | |
}; | |
FMLCommonHandler.instance().addModToResourcePack(container); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment