Making Mods Compatible Across Multiple Versions

Wouldn’t it be possible to make mods compatible across versions? Like 1.7.2 mods work in 1.7.10 or maybe even 1.6.4 mods work in 1.7.10. Maybe it is possible to use some sort of wrapper, like SpecialSource (how md_5 used the mappings to make NMS into MCP source into Minecraft source.) Couldn’t it be possible to do the same thing (since there is pretty much no reflection involved with Minecraft Forge) we could take fields that were modified in each version, and when the method or class is called, they could replace it with the valid class name? It would be awesome if this was put in Sponge.

What are your thoughts on this?

If you use just Sponge, then it will work across multiple versions.

If you access MC classes, then it will work as long as you don’t use something that ends up being changed in the next MC version.

I’m not just talking about sponge, I am talking about all mods. Say you take a 1.6.4 ddivinerpg mod, and you want to make it work In 1.7.10. I was wondering if this kind of thing was possible. I know sponge will work for multiple versions, but just mods in general.

Depends what the mod does.

If the mod uses some MC object, and that object changes, then now the mod is broken.

However, with any sizable mod, it’s inevitable something that it touches will change.

I know that, what I am asking if it is possible if there is some kind of SpecialSource wrapper that md_5 has or something that could map the old code of forge into the new code… Thanks :wink:

It’s not a simple mapping issue because MCP already fixes that problem.

It’s the entire structure of the code changing. For example, if you depended on block ID numbers and data values, and then it changes completely so now you work with strings and there aren’t even data values anymore, no basic mapper can fix that.

but for minor mods over minor changes to MC they would already work version independently?

That’s what I thought. I thought there was a work around but there apparently isn’t. Thank you

Minor mods have a smaller tendency to break.

However, you still can’t predict what will break. For example, you can consider a mod minor if all it does is print a message when a grass block is right clicked, but it would still be subject to breakage if the block API changed.

Whether a change is minor varies too. Java is fairly strict. Making a method in Java accept a generic collection rather than a specific type of collection would break code, even when such a change in, say, Python, would not.

For this to happen you need very stable mods and minor updates. Impossible.