FML and the ModAPI

cpw edited this page Nov 27, 2012 · 2 revisions

The Mod API and FML

The ModAPI is the future official modding API being developed by Mojang. It is likely to start appearing in the game over the coming releases.

FML will continue to exist once the ModAPI is live for a few simple reasons:

  1. ModAPI is only going to support in world mods. FML supports mods at all levels of the game.
  2. There is never going to be something like coremods.

FML and MC Updates

FML will not be able to become a ModAPI mod itself. It needs to do too much to the engine to ever be able to become a ModAPI mod. This means that each MC update will require a new FML to go along with it. Note that this implies that FML will require a working MCP for the MC update. Though there are no commitment guarantees on this, I hope that MCP will see fit to continue into the future.

How will the ModAPI affect FML?

FML is going to look to encourage mods to migrate to the ModAPI where appropriate. Expect to see things like the GameRegistry deprecate over time as the ModAPI replacements become available.

In the early stages, FML is going to start looking to adding functionality that will simulate anticipated ModAPI behaviours. Specifically, the ServerStarting/ServerStarted events are going to become a lot richer in function and capability. There may be a new ClientWorldConnected event as well, and data synchronization between server and client at connection time to allow for injection of world state.

I hope to model these new event registration APIs on the future ModAPI so that mods that wish to can switch to this code base and won't have to update significantly once the ModAPI happens.

These plans of course will not, in the short term at least, break any backward compatibility to existing mods. In this way I hope to smooth the transition from FML and Forge to ModAPI, where appropriate.

Finally, ModAPI, except maybe the merest hints, is not going to be in MC 1.5: . In my opinion, the ModAPI will only make an appearance as the loading code at first, probably in 1.6.

Wishlist for the API

Some things I would like the API to be able to do:

  1. Pluggable loading. This is relatively easy, but by doing this, I could "plug-in" FML/Forge mod loading support to the vanilla mod loader once it appears.
  2. Mod type metadata. This would be epic. If the vanilla plugin loader could be plugged, I could plugin an "FML" type, and then mods distributed through the vanilla mod distribution channels could declare themselves as an "FML" mod type and we could score epic wins all round. I really hope that the vanilla distribution/loading scheme allows for this kind of thing...