mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-28 15:56:02 +00:00
Fix dependency checking: you can depend on specific versions of FML
This commit is contained in:
1 parent
290a3c94b7
commit
4f70d23d0e
4 files changed
+22
-19
No files matched your search
@@ -239,7 +239,7 @@ public class FMLCommonHandler
|
||||
{
|
||||
Builder brd = ImmutableList.<String>builder();
|
||||
brd.add(Loader.instance().getMCVersionString());
|
||||
brd.add(Loader.instance().getFMLVersionString());
|
||||
brd.add("FML v"+Loader.instance().getFMLVersionString());
|
||||
String forgeBranding = (String) callForgeMethod("getBrandingVersion");
|
||||
if (!Strings.isNullOrEmpty(forgeBranding))
|
||||
{
|
||||
|
||||
@@ -218,7 +218,7 @@ public class Loader
|
||||
}
|
||||
if (!versionMissingMods.isEmpty())
|
||||
{
|
||||
FMLLog.severe("The mod %s (%s) requires mod versions %s to be available", mod.getModId(), mod.getName(), missingMods);
|
||||
FMLLog.severe("The mod %s (%s) requires mod versions %s to be available", mod.getModId(), mod.getName(), versionMissingMods);
|
||||
throw new MissingModsException(versionMissingMods);
|
||||
}
|
||||
}
|
||||
@@ -545,7 +545,7 @@ public class Loader
|
||||
*/
|
||||
public String getFMLVersionString()
|
||||
{
|
||||
return String.format("FML v%s.%s.%s.%s", major, minor, rev, build);
|
||||
return String.format("%s.%s.%s.%s", major, minor, rev, build);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -37,8 +37,6 @@ public class ModSorter
|
||||
private ModContainer before = new DummyModContainer();
|
||||
private ModContainer after = new DummyModContainer();
|
||||
|
||||
private List<ModContainer> immutableMods;
|
||||
|
||||
public ModSorter(List<ModContainer> modList, Map<String, ModContainer> nameLookup)
|
||||
{
|
||||
buildGraph(modList, nameLookup);
|
||||
@@ -47,7 +45,6 @@ public class ModSorter
|
||||
private void buildGraph(List<ModContainer> modList, Map<String, ModContainer> nameLookup)
|
||||
{
|
||||
modGraph = new DirectedGraph<ModContainer>();
|
||||
immutableMods = Lists.newArrayList();
|
||||
modGraph.addNode(beforeAll);
|
||||
modGraph.addNode(before);
|
||||
modGraph.addNode(afterAll);
|
||||
@@ -58,20 +55,18 @@ public class ModSorter
|
||||
|
||||
for (ModContainer mod : modList)
|
||||
{
|
||||
if (!mod.isImmutable())
|
||||
{
|
||||
modGraph.addNode(mod);
|
||||
}
|
||||
else
|
||||
{
|
||||
immutableMods.add(mod);
|
||||
}
|
||||
modGraph.addNode(mod);
|
||||
}
|
||||
|
||||
for (ModContainer mod : modList)
|
||||
{
|
||||
if (mod.isImmutable())
|
||||
{
|
||||
// Immutable mods are always before everything
|
||||
modGraph.addEdge(beforeAll, mod);
|
||||
modGraph.addEdge(mod, before);
|
||||
continue;
|
||||
}
|
||||
boolean preDepAdded = false;
|
||||
boolean postDepAdded = false;
|
||||
|
||||
@@ -133,7 +128,6 @@ public class ModSorter
|
||||
{
|
||||
List<ModContainer> sortedList = TopologicalSort.topologicalSort(modGraph);
|
||||
sortedList.removeAll(Arrays.asList(new ModContainer[] {beforeAll, before, after, afterAll}));
|
||||
immutableMods.addAll(sortedList);
|
||||
return immutableMods;
|
||||
return sortedList;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user