Sinytra / Connector

A compatibility layer that allows running Fabric mods on NeoForge
https://sinytra.org/docs/connector
MIT License
531 stars 23 forks source link

Axiom crashes with Sinytra - Neoforge 1.21 #1414

Open KubFire opened 2 months ago

KubFire commented 2 months ago

Mod Name

Axiom

Mod Homepage

https://modrinth.com/mod/axiom/versions

Minecraft version

1.21.1

Describe the bug

When I launch the game as usual, with only Axiom, Sinytra, Connector Extras, and Forgified Fabric, the game crashes while loading writing this error code:"The game crashed whilst initializing game Error: java.lang.NoClassDefFoundError: net/fabricmc/fabric/impl/client/rendering/FabricShaderProgram"

Steps to reproduce

  1. run Axiom 4.1.0 with Neoforge 1.21.51, Sinytra Connector 2.0.0, Connector Extras1.21, Forgified Fabric 0.102.0
  2. Game crashes on start up
  3. Error "The game crashed whilst initializing game Error: java.lang.NoClassDefFoundError: net/fabricmc/fabric/impl/client/rendering/FabricSh

Logs

https://gist.github.com/KubFire/90156bc7794c40bdfa81945ede155944

Additional context

No response

Su5eD commented 1 month ago

@Moulberry is there any reason Axiom tries to access FAPI internals? From what I can see FabricShaderProgram does not come with any instance methods or custom behavior that would require accessing the class directly.

Usually I'd look at the mod's source, but since Axiom goes "User must not reverse engineer, decompile, disassemble, modify, translate, or make any attempt to discover the source code of, the Product.", I figured I'd ask instead.

Thank you.

Moulberry commented 1 month ago

@Moulberry is there any reason Axiom tries to access FAPI internals? From what I can see FabricShaderProgram does not come with any instance methods or custom behavior that would require accessing the class directly.

Usually I'd look at the mod's source, but since Axiom goes "User must not reverse engineer, decompile, disassemble, modify, translate, or make any attempt to discover the source code of, the Product.", I figured I'd ask instead.

Thank you.

This is the reason: https://github.com/FabricMC/fabric/blob/e521378444edf1a1f4d41311b8be7edf2c17aef1/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/mixin/client/rendering/shader/ShaderProgramMixin.java#L43

I'll rewrite the shader manager to not use FabricShaderProgram directly and instead use the event. Sorry for any trouble this has caused.

Su5eD commented 1 month ago

Thanks for the prompt response!

If that's the case, I'll be happy to make changes on my end to accomodate to the mod's needs. Knowing the reason behind it helps all the more in not accidentally removing the seemingly redundant class in the future, as we don't use it ourselves in FFAPI.

Moulberry commented 1 month ago

Thanks for the prompt response!

If that's the case, I'll be happy to make changes on my end to accomodate to the mod's needs. Knowing the reason behind it helps all the more in not accidentally removing the seemingly redundant class in the future, as we don't use it ourselves in FFAPI.

For Axiom it's not so much of an issue, it's an easy fix on my end (in fact I've already made the change, just not released).

In terms of compatibility with other mods, the biggest problem I'm aware of would be anything using the core shader functionality in Satin, as they take advantage of the FabricShaderProgram class in an identical manner: https://github.com/Ladysnake/Satin/blob/7844281a479b0d10e330bc563fd68255f0917ceb/src/main/java/org/ladysnake/satin/impl/ResettableManagedCoreShader.java#L58-L59

Probably don't need to adjust anything in Sinytra now, I only mention it as it might save some searching if the issue pops up in the future

KubFire commented 1 month ago

So for us, mere mortals, what is the take-away? 😃 Wait for next Axiom patch or some DIY patch through configs? Thanks!

WitherTM commented 1 month ago

So for us, mere mortals, what is the take-away? 😃 Wait for next Axiom patch or some DIY patch through configs? Thanks!

wait for the next patch

Moulberry commented 1 month ago

So for us, mere mortals, what is the take-away? 😃 Wait for next Axiom patch or some DIY patch through configs? Thanks!

There's a pretty big experimental change (client requesting entity data from server for copy/paste) I made for 4.2, so the next update needs a lot of testing before it's ready. I expect at least a couple weeks before it's ready. I pinned a patched version of an older commit to the general channel in the Axiom discord in the meantime if you need