diff --git a/fml/src/main/java/cpw/mods/fml/common/event/FMLMissingMappingsEvent.java b/fml/src/main/java/cpw/mods/fml/common/event/FMLMissingMappingsEvent.java index 94ea8e3eaa..8b9dc04d30 100644 --- a/fml/src/main/java/cpw/mods/fml/common/event/FMLMissingMappingsEvent.java +++ b/fml/src/main/java/cpw/mods/fml/common/event/FMLMissingMappingsEvent.java @@ -52,7 +52,11 @@ public class FMLMissingMappingsEvent extends FMLEvent { /** * Remap this name to a new name (add a migration mapping) */ - REMAP + REMAP, + /** + * Allow a block to exist without itemblock anymore + */ + BLOCKONLY } public static class MissingMapping { public final GameRegistry.Type type; @@ -138,6 +142,12 @@ public class FMLMissingMappingsEvent extends FMLEvent { this.target = target; } + public void skipItemBlock() + { + if (type != GameRegistry.Type.ITEM) throw new IllegalArgumentException("Cannot skip an item that is a block"); + if (GameData.getBlockRegistry().getRaw(id) == null) throw new IllegalArgumentException("Cannot skip an ItemBlock that doesn't have a Block"); + action = Action.BLOCKONLY; + } // internal public Action getAction() 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 b4c59f189f..ec1f30801d 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 @@ -632,6 +632,12 @@ public class GameData { remaps.put(newName, new Integer[] { currId, newId }); } } + else if (action == FMLMissingMappingsEvent.Action.BLOCKONLY) + { + // Pulled out specifically so the block doesn't get reassigned a new ID just because it's + // Item block has gone away + FMLLog.fine("The ItemBlock %s is no longer present in the game. The residual block will remain", remap.name); + } else { // block item missing, warn as requested and block the id