Fix firing the remap event. It always fires now, and additionally fires when the registry reverts to frozen.

Most mods refer to the gameregistry for ids they care about, so this shouldn't affect anything significantly,
but if your mod was dependent on their being content in the remap event, and only acting on that content,
empty content means it's "reverted to frozen" state - the state at the start of the game.
This commit is contained in:
cpw 2015-11-10 16:40:27 -05:00
parent c474da04b3
commit aa8eaf2b28
2 changed files with 4 additions and 8 deletions

View file

@ -980,16 +980,9 @@ public class Loader
}
public void fireRemapEvent(Map<String, Integer[]> remaps)
{
if (remaps.isEmpty())
{
FMLLog.finer("Skipping remap event - no remaps occured");
}
else
{
modController.propogateStateMessage(new FMLModIdMappingEvent(remaps));
}
}
public void runtimeDisableMod(String modId)
{

View file

@ -39,6 +39,7 @@ import com.google.common.collect.HashBasedTable;
import com.google.common.collect.HashBiMap;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableListMultimap;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
@ -735,6 +736,8 @@ public class GameData {
getMain().set(frozen);
}
// the id mapping has reverted, fire remap events for those that care about id changes
Loader.instance().fireRemapEvent(ImmutableMap.<String,Integer[]>of());
// the id mapping has reverted, ensure we sync up the object holders
ObjectHolderRegistry.INSTANCE.applyObjectHolders();
}