Enable Enforcement of modid formatting. Must be lowercase and <= 64 characters

This commit is contained in:
LexManos 2016-12-09 14:36:15 -08:00
parent babe0c2d53
commit 7fe8c48983
1 changed files with 6 additions and 3 deletions

View File

@ -133,12 +133,15 @@ public class FMLModContainer implements ModContainer
{
throw new IllegalArgumentException("Modid cannot be null or empty");
}
if (modid.length() > 64) {
FMLLog.bigWarning("The modid %s is longer than the recommended maximum of 64 characters. Truncation will be enforced in 1.11", modid);
if (modid.length() > 64)
{
FMLLog.bigWarning("The modid %s is longer than the recommended maximum of 64 characters. Truncation is enforced in 1.11", modid);
throw new IllegalArgumentException(String.format("The modid %s is longer than the recommended maximum of 64 characters. Truncation is enforced in 1.11", modid));
}
if (!modid.equals(modid.toLowerCase(Locale.ENGLISH)))
{
FMLLog.bigWarning("The modid %s is not the same as it's lowercase version. Lowercasing will be enforced in 1.11", modid);
FMLLog.bigWarning("The modid %s is not the same as it's lowercase version. Lowercasing is enforced in 1.11", modid);
throw new IllegalArgumentException(String.format("The modid %s is not the same as it's lowercase version. Lowercasing will be enforced in 1.11", modid));
}
}
private ILanguageAdapter getLanguageAdapter()