[Dev] 1.14 port
Pyrofab opened this issue ยท 4 comments
There are a few mod developers who would be keen on porting this to 1.14 using the Fabric mod loader (kotlin and mixins are available). What would your stance be on such a port ?
I'm not in principle opposed to a fabric 1.14 port but I'd really like to avoid having two completely separate versions of the mod because that effectively doubles maintenance cost. And I'd rather not already abandon the 1.12 / forge version, especially since we might need the forge compatibility parts again.
For another mod I'm maintaining, I've written a simple pre-processor which supports stuff like
//#if MC>=11400
someFabricThing()
//#else
//$$ howItsDoneOnForge()
//#endif
and can automatically convert source code (and mixin annotations) between the different mappings every time you build. However, because it uses the eclipse java compiler internally, it only works with java, so that won't do unless there are similar tools for kotlin.
Are you aware of any other projects in the modding world which solve the double-the-maintenance-cost problem?
Oh, you are a Replay Mod dev, nice!
What I see most people do when maintaining several versions is to simply make several branches and cherry-pick commits from the main one.
Apart from that, some people create a big abstraction layer (eg. mcjty's compatlayer), but that would be a very hard task to bridge between fabric and forge.
Alright so for curiosity's sake I have taken a look at what it would take to port to Fabric 1.14.
First and foremost: Good Job, this is an intricate mod, and Good Luck, for it will be some work to port.
As a reference, my sketch of a port can be found here: https://github.com/Pyrofab/BetterPortals/tree/fabric (only the buildscript compiles ๐)
Obviously, the mappings are the biggest issue but they can be handled with enough patience.
Main notes (apologies if you know all this):
- Capabilities are replaced by a mixin to (Server)PlayerEntity to directly implement the capability provider
- Portal block replacements could be replaced with a mixin to
{PortalBlock.class, EndPortalBlock.class}
, or, to reduce porting efforts, an injection at the tail ofBlocks.<clinit>
- There were quite a few changes to world data structures, but it does not seem to affect the mod too deeply (
PalettedContainer<BlockState>
is about equivalent toBlockStateContainer
) - Forge has patches to load shaders from domains other than Minecraft's. The Satin library re-adds those patches.
- Use of packets changes a bit, but with use of the Crochet library, it boils down to regex search-replace
javax.vecmath
disappears entirely. I have myself replaced it with JOML- Forge events are annoying to replace, but the mod would probably gain from using adequate injections. There are also a couple event libraries lying around besides Fabric API (eg. Cloth, TextileLib)
I hope that helps in some way; I don't intend to finish my port, but if you need help I will be glad to provide.