A248 / LibertyBans

The be-all, end-all of discipline.
https://ci.hahota.net:8443/job/LibertyBans/
GNU Affero General Public License v3.0
166 stars 40 forks source link

[Feature Request]: Fabric Support #120

Open ahdg6 opened 2 years ago

ahdg6 commented 2 years ago

I have confirmed that ...

Description

As Forge is being replaced by Fabric in modern Minecraft version, Supporting Sponge may not worth the efforts(Only for 1.16.5 and later, 1.12.2 is good but it can't run with Java11). In that case, a Fabric support may suit for LibertyBans future development. I haven't seen any punishment plugin for Fabric and It would be awesome to see LibertyBans to be the first one.

Some Lib that may help you: Adventure Cloud - Cross Platform Command framework

A248 commented 2 years ago

If a platform uses the Adventure API, it isn't much work to add support for it. LibertyBans already uses the Adventure library, so if Fabric uses Adventure too, the Fabric implementation will be easy to create.

Sponge 8 uses Adventure as well. As I understand it, Fabric and Sponge are worthy competitors, having comparable quality of API. So, it would be just to support both of them in LibertyBans (If it were the case that Fabric had an API as under-specified as BungeeCord's, then I would be less willing to support Fabric, but I doubt this).

A248 commented 2 years ago

To become more acquainted with Fabric I started to investigate the matter. However, because LibertyBans uses Maven as its build system, and Fabric effectively requires mods to use Gradle, it is not likely I will be able to add Fabric support.

It is an astronomical task to switch LibertyBans from Maven to Gradle. Despite Maven's status as the most common build tool in the Java ecosystem, the Fabric toolchain does not support Maven. So, Fabric support will not arrive but after a very long time or after a very significant effort.

It is possible we could embed a miniature Gradle build inside a larger Maven build. However, this does not work very well: I have done the opposite (Maven inside of Gradle) before. It is very messy and redundant. Gradle and Maven are not simply not intended to run inside of each other.


Why Fabric Requires Gradle

Rather than defining its own API which encapsulates the Minecraft server, Fabric exposes classes from the Minecraft server directly.

The Minecraft classes are proprietary, so Fabric cannot distribute them. To work around this, Fabric mods must generate the Minecraft classes during the build. (To use an analogy: It's as if each Fabric mod must run its own copy of SpigotMC's BuildTools)

Fabric has created a Gradle plugin to do this. Because the Fabric toolchain depends on Gradle, the documentation is exclusively focused on Gradle and describes examples for Gradle. They do not even mention Maven. It is simply assumed that modders use Gradle.

This presents 3 alternatives for LibertyBans:

  1. Convert our entire build to use Gradle. This is an astronomical task, although it can be done; we can reach the stars if we dedicate ourselves to the effort. See also #68
  2. Rewrite the Fabric build toolchain so that all the tooling supports Maven. This would require a vast undertaking.
  3. Embed a Gradle build inside the larger Maven build. Gradle would handle the Fabric mod while Maven would handle the rest of the LibertyBans build.
ahdg6 commented 2 years ago

oh. What a pity. Anyway, Thank you for your efforts in investigating.

BlueTree242 commented 2 years ago

Ill work to make this a gradle project, never leave fabric behind A2, its an important software

A248 commented 1 year ago

Fabric support is still possible, although it may require a downstream consumer of the LibertyBans project to depend on the core modules and bundle a plugin via Gradle. This isn't hard to accomplish although perhaps it could be placed in a new repository. Someone else could maintain the Fabric platform of LibertyBans if they wanted to.