From bc57ff9e83803d804e9d5374d76273fcd68611f4 Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 31 Oct 2013 09:39:34 -0400 Subject: [PATCH] Fix recursive API dependency resolution. Allows nested APIs, such as BuildCraft's --- common/cpw/mods/fml/common/ModAPIManager.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/common/cpw/mods/fml/common/ModAPIManager.java b/common/cpw/mods/fml/common/ModAPIManager.java index 50df55f8af..fa80cd4b4d 100644 --- a/common/cpw/mods/fml/common/ModAPIManager.java +++ b/common/cpw/mods/fml/common/ModAPIManager.java @@ -177,6 +177,19 @@ public class ModAPIManager { } } } + if (apiContainers.containsKey(container.ownerMod.getLabel())) + { + ArtifactVersion owner = container.ownerMod; + do + { + APIContainer parent = apiContainers.get(owner.getLabel()); + FMLLog.finest("Removing upstream parent %s from %s", parent.ownerMod.getLabel(), container); + container.currentReferents.remove(parent.ownerMod.getLabel()); + container.referredMods.remove(parent.ownerMod); + owner = parent.ownerMod; + } + while (apiContainers.containsKey(owner.getLabel())); + } FMLLog.fine("Creating API container dummy for API %s: owner: %s, dependents: %s", container.providedAPI, container.ownerMod, container.referredMods); } }