
jar in jar or relocate kyori adventure
htpnet opened this issue ยท 1 comments
Description
It appears that both spark and our mod using kyori adventure export the same package, net.kyori.adventure.text.serializer.gson.impl, which leads to a ResolutionException
Exception in thread "main" java.lang.module.ResolutionException: Modules net.kyori.adventure.text.serializer.gson and spark export package net.kyori.adventure.text.serializer.gson.impl to module wirelesschargers
at java.base/java.lang.module.Resolver.resolveFail(Resolver.java:900)
...
Spark only uses 2 classes from it. Use a jar-in-jar approach to include its dependencies in a way that avoids conflicts.
Relocate the conflicting package to avoid it being exported globally. ty
Reproduction Steps
Use a mod setup that includes both spark and kyori adventure dependencies.
Attempt to start the server.
Observe the crash during the module resolution phase.
Expected Behaviour
Not crash
Platform Information
- Minecraft Version: 1.21.1
- Platform Type: Server
- Platform Brand: NeoForge
- Platform Version: Latest
Spark Version
spark-1.10.109-neoforge.jar
Logs and Configs
No response
Extra Details
No response
I have released a backported fix here:
https://modrinth.com/mod/spark/version/v5qtqRQi
https://legacy.curseforge.com/minecraft/mc-mods/spark/files/6225208