Skip to content

Commit

Permalink
Try and make 1.13 mods more obviously wrong in 1.12..
Browse files Browse the repository at this point in the history
Signed-off-by: cpw <[email protected]>
  • Loading branch information
cpw committed Apr 6, 2019
1 parent e7beed4 commit 1f12642
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/main/java/net/minecraftforge/fml/common/FMLModContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,20 @@ private void sanityCheckModId()
String modid = (String)this.descriptor.get("modid");
if (Strings.isNullOrEmpty(modid))
{
throw new IllegalArgumentException("The modId is null or empty");
// In FML 1.13, the "value" field is used for modid, not the "modid" field.
// This is a VERY strong indicator that this is a 1.13 mod. Strong enough that we will assume it is, and
// treat it accordingly
modid = (String) this.descriptor.get("value");
if (Strings.isNullOrEmpty(modid)) {
throw new IllegalArgumentException("The modId is null or empty");
} else {
// This is a 1.13 mod
FMLLog.bigWarning("The mod {} has been identified as a probable 1.13 or greater mod. Things will not work well.", modid);
// This is a 1.13+ mod, lets tell the crashing code about that
this.descriptor.put("acceptedMinecraftVersions", "[1.13,)");
// We'll push our "modid" back into the map, so that crashing code can print a sensible value
this.descriptor.put("modid", modid);
}
}
if (modid.length() > 64)
{
Expand Down

0 comments on commit 1f12642

Please sign in to comment.