Better Animals Plus

Better Animals Plus

24M Downloads

Better Animals Plus Conflicts w/ BYG by hiding Jankson from BYG.

CorgiTaco opened this issue ยท 6 comments

commented

Describe what you were doing before the crash

Launching MC

To Reproduce

Steps to reproduce the behavior (if possible):
Use the following mods:
image

Crash Log (REQUIRED)

https://gist.github.com/CorgiTaco/116877593c65428d1746a8f555cde539

Versions

  • Minecraft Version: 1.18.2
  • Architectury API Version: 4.1.34
  • Platform (Forge/Fabric): Fabric
  • Fabric Loader Version: 0.13.3
  • Fabric API Version: 0.48.0
  • Mod Version: 11.0.5

Additional context

Better Animals Plus manages to causes the jankson jar in jar in BYG to not be valid on the class path:
Caused by: java.lang.NoSuchMethodError: 'blue.endless.jankson.Jankson$Builder blue.endless.jankson.Jankson$Builder.allowBareRootObject()'

I suspect there's a conflict with your addition of Jankson as you specify here in your README and BYG's addition of Jankson here

commented

BYG can also resolve this issue by performing shadow relocation. It's the same thing we will do to fix this, but in the meantime just use the relocate clause.

commented

Do you have an example of how to do this on fabric? Couldn't find it in your gradle files :P

commented
shadowJar {
    relocate "blue.endless.jankson" "potionstudios.byg.jankson"
}

https://imperceptiblethoughts.com/shadow/configuration/relocation/

I would suggest opening the jar file to search for additional conflicting packages.
Do note relocation requires a relatively new version of shadow plugin, I think 5.0 or higher? Most projects now use 7.0 so it shouldn't be a huge concern.

Example in my files here: https://maven.itsmeow.dev/scripts/imdlib.gradle

commented

Yeah i use shadow on forge already, when i tried it on fabric yesterday I had no luck bc the jar wouldn't remap it, I'll try what you've given

commented

Jankson has no Minecraft code, so no remapping should be needed. If you're saying the shadowJar is not being remapped, you need to tell loom to do that.

remapJar {
    input.set shadowJar.archiveFile
}

This is architectury-loom, but it does a similar thing + some additional stuff with "fixJar" for my shadowed mod-type library.
https://github.com/itsmeow/betteranimalsplus/blob/1.16/fabric/build.gradle

commented

Re-opening because I need to fix this on my side as well.