diff --git a/src/mantle/event/Migration.java b/src/mantle/event/Migration.java new file mode 100644 index 0000000..956db51 --- /dev/null +++ b/src/mantle/event/Migration.java @@ -0,0 +1,50 @@ +package mantle.event; + +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.event.FMLMissingMappingsEvent; +import cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping; + +public abstract class Migration +{ + private ModContainer mod; + + private String modID; + + /* + * Store the mod ID so we can convert e.g "item" to "mod:item" later. + */ + public Migration(ModContainer m) + { + m.getModId(); + } + + /* + * Add a new migration to the internal replacement map e.g. "olditem" -> "newitem" (without ID prefix!). + * Use an encapsulated object of form Map to store this. + * The prefix will be created using the ID given during construction during processing. + */ + public void addMigration (String old, String newName) + { + } + + /* + * Register an old ID that's been removed entirely. This isn't suitable for renaming operations! + * Store this in a List seperate to the rename mapping. + */ + public void addRemoval (String id) + { + }; + + /* + * This works on the assumption the FML event will have a list of string IDs that are missing. + * During this phase, check for old IDs and remap as needed, or destroy ones marked for removal. + */ + public void processMigrationEvent (FMLMissingMappingsEvent event) + { + event.applyModContainer(mod); + for (MissingMapping miss : event.get()) + { + } + } + +} \ No newline at end of file