mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 11:59:25 +00:00
Add details message to MissingModsException and WrongMinecraftVersionException to make the Crash logs more useful.
This commit is contained in:
1 parent
0dc112a198
commit
229848a4cb
3 files changed
+5
-3
No files matched your search
@@ -224,7 +224,7 @@ public class Loader
|
||||
{
|
||||
versionMissingMods.add(names.get(modid));
|
||||
}
|
||||
throw new MissingModsException(versionMissingMods);
|
||||
throw new MissingModsException(versionMissingMods, mod.getModId(), mod.getName());
|
||||
}
|
||||
reqList.putAll(mod.getModId(), names.keySet());
|
||||
ImmutableList<ArtifactVersion> allDeps = ImmutableList.<ArtifactVersion>builder().addAll(mod.getDependants()).addAll(mod.getDependencies()).build();
|
||||
@@ -241,7 +241,7 @@ public class Loader
|
||||
if (!versionMissingMods.isEmpty())
|
||||
{
|
||||
FMLLog.severe("The mod %s (%s) requires mod versions %s to be available", mod.getModId(), mod.getName(), versionMissingMods);
|
||||
throw new MissingModsException(versionMissingMods);
|
||||
throw new MissingModsException(versionMissingMods, mod.getModId(), mod.getName());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,8 +21,9 @@ public class MissingModsException extends RuntimeException
|
||||
private static final long serialVersionUID = 1L;
|
||||
public final Set<ArtifactVersion> missingMods;
|
||||
|
||||
public MissingModsException(Set<ArtifactVersion> missingMods)
|
||||
public MissingModsException(Set<ArtifactVersion> missingMods, String id, String name)
|
||||
{
|
||||
super(String.format("Mod %s (%s) requires %s", id, name, missingMods));
|
||||
this.missingMods = missingMods;
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,7 @@ public class WrongMinecraftVersionException extends RuntimeException
|
||||
|
||||
public WrongMinecraftVersionException(ModContainer mod)
|
||||
{
|
||||
super(String.format("Wrong Minecraft vbersion for %s", mod.getModId()));
|
||||
this.mod = mod;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user