From 289678252b3712b97b280bffe6459379f20922b8 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 --- fml/common/cpw/mods/fml/common/ModAPIManager.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/fml/common/cpw/mods/fml/common/ModAPIManager.java b/fml/common/cpw/mods/fml/common/ModAPIManager.java index 50df55f8af..fa80cd4b4d 100644 --- a/fml/common/cpw/mods/fml/common/ModAPIManager.java +++ b/fml/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); } }