use of net.minecraftforge.fml.loading.moddiscovery.ModInfo in project LoliServer by Loli-Server.
the class ModSorter method addDependency.
@SuppressWarnings("UnstableApiUsage")
private void addDependency(MutableGraph<ModFileInfo> topoGraph, IModInfo.ModVersion dep) {
final ModFileInfo self = (ModFileInfo) dep.getOwner().getOwningFile();
final ModInfo targetModInfo = modIdNameLookup.get(dep.getModId());
// soft dep that doesn't exist. Just return. No edge required.
if (targetModInfo == null)
return;
final ModFileInfo target = targetModInfo.getOwningFile();
if (self == target)
// in case a jar has two mods that have dependencies between
return;
switch(dep.getOrdering()) {
case BEFORE:
topoGraph.putEdge(self, target);
break;
case AFTER:
topoGraph.putEdge(target, self);
break;
case NONE:
break;
}
}
Aggregations