Minecraft Transit Railway (Automated trains, planes, and more!)

Minecraft Transit Railway (Automated trains, planes, and more!)

1M Downloads

Apparent problem with MTR's mixins that causes conflicts.

Veraxiel opened this issue ยท 5 comments

commented

Expected Behaviour
The game should start up.

Actual Behaviour
The game crashes.

Reproduction Steps
Steps to reproduce the behaviour:

  1. Install MTR and Cobblemon together.

Crash Report
latest.log
(No crash report generated.)

Environment

  • Minecraft Version: Fabric 1.19.2
  • Installed Mods: Fabric API, Architectury, Cobblemon, MTR

Additional Information
Hello, I am the art director of the Cobblemon team and I had our devs look at this conflict, but they say they're not even sure why the conflict is happening. When the mods are installed together an MTR mixin fails, but Cobblemon's code seems to have absolutely nothing to do with the mixin that fails. The only part of the player class (class_3222) we touch is for shoulder mounted entities. They believe something must be wrong with MTR's code that's causing this issue. They suggested using "access transformers," and gave me these links to send:

The MTR mixin that fails:
https://github.com/jonafanho/Minecraft-Transit-Railway/blob/master/fabric/src/main/java/mtr/mixin/PlayerTeleportationStateAccessor.java

The only two mixins we have that are even remotely related to it:
https://gitlab.com/cable-mc/cobblemon/-/blob/main/common/src/main/java/com/cobblemon/mod/common/mixin/PlayerMixin.java
https://gitlab.com/cable-mc/cobblemon/-/blob/main/common/src/main/java/com/cobblemon/mod/common/mixin/accessor/AccessorEntity.java

It seems we are unable to fix the conflict on our end, so we wanted to bring this to your attention. You'll likely have to fix it on your end. Thanks.

commented

Thank you, I'll take a look!

commented

To save you some time, I spent a good set of my time working out the actual problem, and it came down to our refmaps. Effectively, while neither of us targeted code that should affect the other, our refmaps were named exactly the same at time of generation from loom. I assume MTR consistently failed as the Cobblemon refmap was selected first due to alphabetical order. I've adjusted our generated refmap names to be unique, and that solved the problem.

I'd recommend for you to also follow suit in that as any mod that just so happens to not alter their generated refmaps can potentially conflict with you, assuming their refmaps are named exactly the same as well. If you want to see the change made on our end, it's incredibly simple and is effectively just a quick loom configuration option: Cobblemon MR

commented

Thanks again for the detailed analysis. Do you think access transformers will provide better compatibility in general or would setting the defaultRefmapName like your code be sufficient?

commented

Setting the refmap name should be efficient enough. Realistically nobody should be matching yours 1:1 in naming and if so, that's on them.

commented

This has been added in the latest update.