GeyserMC / Geyser-Fabric

MIT License
74 stars 18 forks source link

Relocate dependencies to resolve incompatibilities #71

Closed TheLukeGuy closed 2 years ago

TheLukeGuy commented 2 years ago

This fixes three client crashes caused by using Geyser-Fabric with certain mods:

  1. Relocating com.google fixes an exception when clicking "Create New World". Not sure which mod causes this (I use quite a few other mods), but it happens on both Fabric and Quilt.
  2. Relocating it.unimi.dsi.fastutil fixes an exception during mixin transformation. This only happens on Quilt, and it seems to be an incompatibility with Lithium.
  3. Relocating org.slf4j fixes an exception during launch. This also only happens on Quilt, and it seems to be an incompatibility with Iris.
Camotoy commented 2 years ago

Thanks for the PR! I think the root cause here is that these dependencies should be removed from the jar entirely as the Minecraft server provides them. We have code to do that but something in the Gradle migration must have broken that. Can you take a look?

TheLukeGuy commented 2 years ago

Oh, sorry, I missed that! It looks like the issue is that - since the Gradle migration - all of Geyser's dependencies are included directly in the core JAR file that's published to the Maven repository. So this code...

exclude group: 'com.google.guava', module: "guava"
exclude group: 'com.google.code.gson', module: "gson"
exclude group: 'org.slf4j'
exclude group: 'com.nukkitx.fastutil'
exclude group: 'io.netty.incubator'

...does absolutely nothing now. I created GeyserMC/Geyser#3331 which should fix this issue, so I'll close this PR! Alternatively, we could probably configure shadowJar in Geyser-Fabric to remove all of the packages of dependencies from the final JAR file, but that sounds very disgusting.