From aa8eaf2b286e809146b7faf4e59ce801a40eab9b Mon Sep 17 00:00:00 2001 From: cpw Date: Tue, 10 Nov 2015 16:40:27 -0500 Subject: [PATCH] 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. --- fml/src/main/java/cpw/mods/fml/common/Loader.java | 9 +-------- .../main/java/cpw/mods/fml/common/registry/GameData.java | 3 +++ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/fml/src/main/java/cpw/mods/fml/common/Loader.java b/fml/src/main/java/cpw/mods/fml/common/Loader.java index 0f46e8ca9c..85b7002187 100644 --- a/fml/src/main/java/cpw/mods/fml/common/Loader.java +++ b/fml/src/main/java/cpw/mods/fml/common/Loader.java @@ -981,14 +981,7 @@ public class Loader public void fireRemapEvent(Map remaps) { - if (remaps.isEmpty()) - { - FMLLog.finer("Skipping remap event - no remaps occured"); - } - else - { - modController.propogateStateMessage(new FMLModIdMappingEvent(remaps)); - } + modController.propogateStateMessage(new FMLModIdMappingEvent(remaps)); } public void runtimeDisableMod(String modId) diff --git a/fml/src/main/java/cpw/mods/fml/common/registry/GameData.java b/fml/src/main/java/cpw/mods/fml/common/registry/GameData.java index 13698082ba..00a03764ca 100644 --- a/fml/src/main/java/cpw/mods/fml/common/registry/GameData.java +++ b/fml/src/main/java/cpw/mods/fml/common/registry/GameData.java @@ -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.of()); // the id mapping has reverted, ensure we sync up the object holders ObjectHolderRegistry.INSTANCE.applyObjectHolders(); }