From 7fe8c48983a7212c35c5dd51d878f5a744c9123c Mon Sep 17 00:00:00 2001 From: LexManos Date: Fri, 9 Dec 2016 14:36:15 -0800 Subject: [PATCH] Enable Enforcement of modid formatting. Must be lowercase and <= 64 characters --- .../net/minecraftforge/fml/common/FMLModContainer.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/minecraftforge/fml/common/FMLModContainer.java b/src/main/java/net/minecraftforge/fml/common/FMLModContainer.java index 33d64dd9ac..e1e19b25e7 100644 --- a/src/main/java/net/minecraftforge/fml/common/FMLModContainer.java +++ b/src/main/java/net/minecraftforge/fml/common/FMLModContainer.java @@ -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()