Meet the all-new (Neo)ForgifiedFabricAPI! #133
Su5eD
announced in
Announcements
Replies: 3 comments 3 replies
-
Does this change mean we are now purely limited to NeoForge/Fabric mods? Or can all Forge mods be used on NeoForge? I'm literally in the middle of assembling a modpack centered around ForgifiedFabric as we speak |
Beta Was this translation helpful? Give feedback.
1 reply
-
I love you. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Will you still support 1.20.1 after Sinytra Connector gets ported to 1.21 and onward? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Meet the all-new (Neo)ForgifiedFabricAPI!
Hello everyone! I am excited to announce that the Forgified Fabric API is now available on NeoForge for Minecraft 1.21!
While this marks the first milestone towards porting Connector to 1.21 and above, it's also great news for developers who might be interested in using a cross-platform modding API. FFAPI's 1.21 update is a group-up port of the upstream Fabric API with numerous improvements to its stability, performance and overall developer experience. Let's take a brief look below.
📖 To get started with using the Forgified Fabric API in your mod, please take a look at our GitHub repository. For any questions related to using the mod, feel free to ask us on discord.
For those yet unfamiliar with the project - the Forgified Fabric API (FFAPI) is a direct port of Fabric API for the NeoForge modloader, regularly kept up to date with the upstream repository. It is designed to make cross platform mod development easier by allowing developers to use Fabric API as a common library to interact with the game's code on both platforms.
However, it is not an abstraction layer, and loader-specific code (e.g. entrypoints and mod metadata) still needs to be handled individually for each platform.
Past issues....
Yarn mappings
Previously, the Forgified Fabric API was built using Yarn mappings, which are native to Fabric. However, using it in a NeoForge setup caused various difficulties, namely when using reflection and writing coremods. Build times were also badly affected by the necessary remapping process (which had to run on every build or run) that consumed a large amount of memory, not to mention the time it took to complete 40 submodules. Developers reported occasional issues with ForgeGradle deobfuscation in their userdev environments, too.
Ugly coremods
While the upstream Fabric API extensively made us of Fabric mixin's features, Mixin on Forge 1.20.1 would not let us inject into interfaces or constructors. Therefore we had to replace some of Fabric API's simple mixins with messy javascript coremods that made remapping situation even worse and were generally a pain to deal with. The ASMAPI remapping service didn't support remapping class names so we were left with having to use a system property to switch coremod targets between yarn and mojmap (yuck).
...begone!
Now let's talk about all the good stuff the FFAPI update brings.
NeoForge
That's right, we've switched modloaders and we're targeting NeoForge now. Might as well start calling it the NeoForgifiedFabricAPI... NeoForge brought many amazing changes to the rather old-fashioned Forge API, which allow us to further enhance the FFAPI.
Lighter code
Unlike Forge used to, vanilla registries are no longer replaced with a custom system, but rather extended with extra logic without altering their original behavior. Thanks to Neo's smaller footprint, we were able to create bridges for most of Fabric's logic without having to write invasive mixin code. Replacing FAPI's mixins with Neo's events and APIs leads to increased mod compatibility, as well as lowers the chances of accidentally altering other mods' behavior. Parts of the API that used to be rather problematic in the past, such as the registries and network modules, are now almost completely bridged to Neo.
No more remapping
The Forgified Fabric API is now built using Mojmap. We have created a mirror of the upstream Fabric API that we've remapped to Mojmap, so that the FFAPI can use it to sync with upstream. Delegating remapping to an external project means we won't have to remap our jars at build time, leading to faster build times and eliminating userdev-related deobfuscation issues developers have faced in the past.
For all cross-platform development
If you're a Fabric developer looking to bring your mod to NeoForge, yet you don't want to spend precious time rewriting your mod from scratch, the Forgified Fabric API comes to the rescue! Along with our implementation of the Fabric Loader's APIs, you'll be able to keep the vast majority of your code unchanged and still provide a native version of your mod built for NeoForge.
The Forgified Farbic API can be added to your development environment with only a few lines of code, no additional setup required. You can then consume any of the Fabric APIs just like you would on Fabric.
Beta Was this translation helpful? Give feedback.
All reactions