Search in sources :

Example 11 with ModInfo

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;
    }
}
Also used : IModFileInfo(net.minecraftforge.forgespi.language.IModFileInfo) ModFileInfo(net.minecraftforge.fml.loading.moddiscovery.ModFileInfo) IModInfo(net.minecraftforge.forgespi.language.IModInfo) ModInfo(net.minecraftforge.fml.loading.moddiscovery.ModInfo)

Aggregations

ModInfo (net.minecraftforge.fml.loading.moddiscovery.ModInfo)11 IModInfo (net.minecraftforge.forgespi.language.IModInfo)10 IOException (java.io.IOException)6 InputStream (java.io.InputStream)6 TextureManager (net.minecraft.client.renderer.texture.TextureManager)6 Size2i (net.minecraftforge.common.util.Size2i)6 DynamicTexture (net.minecraft.client.renderer.texture.DynamicTexture)5 VersionChecker (net.minecraftforge.fml.VersionChecker)5 MatrixStack (com.mojang.blaze3d.matrix.MatrixStack)4 RenderSystem (com.mojang.blaze3d.systems.RenderSystem)4 Environment (cpw.mods.modlauncher.Environment)4 ArrayList (java.util.ArrayList)4 Collections (java.util.Collections)4 Comparator (java.util.Comparator)4 List (java.util.List)4 Entry (java.util.Map.Entry)4 Consumer (java.util.function.Consumer)4 Function (java.util.function.Function)4 Collectors (java.util.stream.Collectors)4 Minecraft (net.minecraft.client.Minecraft)4