![VulkanMod](https://media.forgecdn.net/avatars/thumbnails/561/294/256/256/637913373178716740.png)
Forge version
DragonBeast829 opened this issue ยท 9 comments
I know making mods is hard, but I (and many others) prefer forge over fabric. Would you make a forge version of the mod for forge users?
(Sorry this is long)
This is something I've thought about as well as in theory at least is should be possible as "Dual Loaders" for Forge+Fabric have existed for some time.
AFAIK the mod has little to do with fabric at all, and mostly exists as a separate Vulkan renderer that uses little vanilla or fabric code at all (Outside of specific OpenGL/Vanilla hacks to replace the OpenGL Renderer). So on paper adding forge support might be surprising easy.
If I'm understanding this correctly, The main issue with this is the Mixin format used by Forge (Access Transformers instead of Fabric's Access Wideners), which are not compatible with one another and will likely need to be ported by hand to work with Forge's system.
This is a problem as while little fabric code is used, the Mod is very dependent on Mixins to function at all, which may involve a lot of code rewrites to fix the Mixins to work with Forge.
Unless porting to Forge is super easy (i.e. Forge Mixins, Access Transformers, and the OpenGL renderer are very similar to Fabric), a Forge port AFAIK is very unlikely, especially if the forge renderer setup is radically different.
xCollateral may be more knowledgeable about this, but even if a Forge port is straightforward, it likely isn't a priority ATM.
tl;dr: Forge version (Possibly using Fabric/Forge Multiloader) is unlikely AFAIK and would only happen if minimal code rewrites are needed.
(I am not an expert in this so likely not 100% correct about the below)
- This mostly boils down to compatibility issues with Mixins. (Mixins are needed to allow hacking into the vanilla code).
-
Forge uses Access Transformers while Fabric uses Access Wideners for Mixins (Which are not the same)
-
Can't be avoided as Mixins are 100% critical and the mod cannot function without them.
- This may also cause major mod breakage/glitches with specific mods using custom OpenGL as a result, (as the forge renderer pipeline may not be 100% identical to vanilla/fabric)
AFAIK xCollateral is the only dev on this mod, so unfortunately a Forge port is very unlikely ATM.
Edit; Sorry for making stupid assumptions like that, I wasn't aware a Forge port/Multiloader might in fact be possible/feasible.
Also, I have no knowledge of how OpenGL and Vulkan work so I don't know how hard this would be. I understand if it would be hard and you don't want to do it.
I've been trying to make a forge port, but there are some issues with library loading I can't get around.
It is possible to make a mod compatible with both at the same time (Fabric/Forge Multiloader) which might be useful as reference in case it makes anything easier. In theory it may not be nessacery to split the mod into separate Fabric/Forge versions
(The only issue being that I have no clue where it sets up its libraries so it likely isn't the best option): This One seem to have /Use/Include Libraries though
I Would like to help more, but I'm mostly useless with Modding APIs as the last time I make a forge mod was over 4-ish years ago on 1.12.2 which I can barely remember, so sorry if this doesn't help much.
Also found a 1.18.2 version/Branch with a Forge Mixin if Porting the AccessWideners to the Access Transformers are a problem/Issue
It looks like you can actually use the same Mixins classes without needing to duplicate them into seperate Fabric/Forge Versions
The problem is lwjgl libraries loading by the mod clashes with Forge/Minecraft lwjgl.
tl;dr; I'm likely 100% wrong about this, but remove all LWJGL dependencies from build.gradle and use the ForgeGradle ones instead, ForgeGradle seems to hardcode everything as it somehow seems to work and link correctly
I really have no clue about what I'm talking about, but at least looking at the MultiLoader template you actually don't provide/Specify the LWJGL dependencies manually as is seems you could access LWJGL classes just fine and without issue.
(As ForgeGradle seems to like to hardcode everything and forcibly do it for you. )
If I'm not wrong/mistaken, it might be possible to remove all the LWJGL dependencies from build.gradle and use the ForgeGradle ones instead, and it somehow seems to work and link correctly.
However I'm not a Forge expert so I'm likely 100% wrong about this.
I've made a mod that's compatible with Forge, Fabric, and Qulit. Mixins work very similar on all versions. However, it uses Architectury (which is another dependency).
Take a look at my Mine Ways mod for an example.