mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 02:55:17 +00:00
And more mod sorting fixes.
This commit is contained in:
1 parent
93d5934ea7
commit
2d9b88bd52
1 file changed
+14
-14
@@ -32,7 +32,7 @@ public class LoadController
|
|||||||
private Multimap<String, Throwable> errors = ArrayListMultimap.create();
|
private Multimap<String, Throwable> errors = ArrayListMultimap.create();
|
||||||
private Map<String, ModContainer> modList;
|
private Map<String, ModContainer> modList;
|
||||||
private List<ModContainer> activeModList = Lists.newArrayList();
|
private List<ModContainer> activeModList = Lists.newArrayList();
|
||||||
private String activeContainer;
|
private ModContainer activeContainer;
|
||||||
private BiMap<ModContainer, Object> modObjectList;
|
private BiMap<ModContainer, Object> modObjectList;
|
||||||
|
|
||||||
public LoadController(Loader loader)
|
public LoadController(Loader loader)
|
||||||
@@ -105,7 +105,7 @@ public class LoadController
|
|||||||
|
|
||||||
public ModContainer activeContainer()
|
public ModContainer activeContainer()
|
||||||
{
|
{
|
||||||
return activeContainer!=null ? modList.get(activeContainer) : null;
|
return activeContainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
@@ -115,21 +115,22 @@ public class LoadController
|
|||||||
{
|
{
|
||||||
modObjectList = buildModObjectList();
|
modObjectList = buildModObjectList();
|
||||||
}
|
}
|
||||||
for (Map.Entry<String,EventBus> entry : eventChannels.entrySet())
|
for (ModContainer mc : activeModList)
|
||||||
{
|
{
|
||||||
activeContainer = entry.getKey();
|
activeContainer = mc;
|
||||||
|
String modId = mc.getModId();
|
||||||
stateEvent.applyModContainer(activeContainer());
|
stateEvent.applyModContainer(activeContainer());
|
||||||
FMLLog.finer("Posting state event %s to mod %s", stateEvent, entry.getKey());
|
FMLLog.finer("Posting state event %s to mod %s", stateEvent, modId);
|
||||||
entry.getValue().post(stateEvent);
|
eventChannels.get(modId).post(stateEvent);
|
||||||
FMLLog.finer("State event %s delivered to mod %s", stateEvent, entry.getKey());
|
FMLLog.finer("State event %s delivered to mod %s", stateEvent, modId);
|
||||||
activeContainer = null;
|
activeContainer = null;
|
||||||
if (!errors.containsKey(entry.getKey()))
|
if (!errors.containsKey(modId))
|
||||||
{
|
{
|
||||||
modStates.put(entry.getKey(), stateEvent.getModState());
|
modStates.put(modId, stateEvent.getModState());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
modStates.put(entry.getKey(), ModState.ERRORED);
|
modStates.put(modId, ModState.ERRORED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -162,11 +163,10 @@ public class LoadController
|
|||||||
|
|
||||||
public void printModStates(StringBuilder ret)
|
public void printModStates(StringBuilder ret)
|
||||||
{
|
{
|
||||||
for (String modId : modStates.keySet())
|
for (ModContainer mc : loader.getModList())
|
||||||
{
|
{
|
||||||
ModContainer mod = modList.get(modId);
|
ret.append("\n\t").append(mc.getModId()).append(" [").append(mc.getName()).append("] (").append(mc.getSource().getName()).append(") ");
|
||||||
ret.append("\n\t").append(mod.getName()).append(" (").append(mod.getSource().getName()).append(") ");
|
Joiner.on("->"). appendTo(ret, modStates.get(mc.getModId()));
|
||||||
Joiner.on("->"). appendTo(ret, modStates.get(modId));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user