From 0bff21315cb18f8467fa92a7779f2e09def1638a Mon Sep 17 00:00:00 2001 From: cpw Date: Tue, 31 Mar 2015 15:03:18 -0400 Subject: [PATCH] Rather than try to fall back to the backup level.dat in case of weirdness in the ID map, just fail hard. There is probably a serious modder derp in this case and there's nothing FML can do to recover the situation except avoid making it worse. --- .../java/cpw/mods/fml/common/FMLContainer.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/fml/src/main/java/cpw/mods/fml/common/FMLContainer.java b/fml/src/main/java/cpw/mods/fml/common/FMLContainer.java index 14c05ac8f..5b11da1ad 100644 --- a/fml/src/main/java/cpw/mods/fml/common/FMLContainer.java +++ b/fml/src/main/java/cpw/mods/fml/common/FMLContainer.java @@ -272,7 +272,21 @@ public class FMLContainer extends DummyModContainer implements WorldAccessContai itemSubstitutions.add(dataTag.getString("K")); } } - failedElements = GameData.injectWorldIDMap(dataList, blockedIds, blockAliases, itemAliases, blockSubstitutions, itemSubstitutions, true, true); + try + { + failedElements = GameData.injectWorldIDMap(dataList, blockedIds, blockAliases, itemAliases, blockSubstitutions, itemSubstitutions, true, true); + } catch (IllegalArgumentException ex) + { + // In the case of IllegalArgumentException the state map is utterly toast. We should immediately abort + String msg = "The world state is utterly corrupted and this save is NOT loadable\n\n" + + "There is a high probability that a mod has broken the\n" + + "ID map and there is\n" + + "NOTHING FML or Forge can do to recover this save.\n\n" + + "If you changed your mods, try reverting the change"; + FMLLog.log(Level.FATAL, ex, msg); + StartupQuery.notify(msg); + StartupQuery.abort(); + } } if (failedElements != null && !failedElements.isEmpty())