Skip to content

Relocate adventure service files in the Fabric and Forge jars - #592

Merged
lucko merged 1 commit into
lucko:masterfrom
rishabhvenu:fix/fabric-forge-service-files
Oct 7, 2026
Merged

lucko merged 1 commit into
lucko:masterfrom
rishabhvenu:fix/fabric-forge-service-files

Conversation

@rishabhvenu

Copy link
Copy Markdown
Contributor

Fixes #591

The Fabric and Forge jars relocate adventure to me.lucko.spark.lib.adventure, but the two adventure service files are copied as they are:

META-INF/services/net.kyori.adventure.text.event.DataComponentValueConverterRegistry$Provider
    -> net.kyori.adventure.text.serializer.gson.impl.GsonDataComponentValueConverterProvider
META-INF/services/net.kyori.adventure.text.serializer.json.JSONComponentSerializer$Provider
    -> net.kyori.adventure.text.serializer.gson.impl.JSONComponentSerializerProviderImpl

Those provider classes do not exist under that name in the jar, so any other mod that loads the real adventure services finds spark's entry and fails with ServiceConfigurationError: ... Provider ... not found, which is the PacketEvents crash in the issue.

The NeoForge build already has mergeServiceFiles() for this (#460), which makes shadow relocate the service files too. This adds the same line to the Fabric and Forge shadowJar tasks.

Checked

Built the jars from master and from this branch and listed META-INF/services:

Jar Service files
Fabric, master net.kyori.adventure... pointing at net.kyori.adventure...gson.impl... (same as the published 1.10.187 jar)
Fabric, this branch me.lucko.spark.lib.adventure... pointing at me.lucko.spark.lib.adventure...gson.impl..., which exist in the jar
Forge, published 1.10.187 same unrelocated files as Fabric
Forge, this branch relocated, as above

After the change both jars match what the NeoForge jar already ships.

Then booted a Fabric 26.3 dedicated server (loader 0.19.5, fabric-api 0.162.0) with packetevents-fabric-2.14.0:

Mods Result
PacketEvents only boots
PacketEvents + spark built from master exits during startup with ServiceConfigurationError: net.kyori.adventure.text.event.DataComponentValueConverterRegistry$Provider: Provider net.kyori.adventure.text.serializer.gson.impl.GsonDataComponentValueConverterProvider not found
PacketEvents + spark built from this branch boots, spark loads

Not covered: I did not boot a Forge server; for Forge I only compared the jar contents.

The jars shipped the adventure service files unrelocated, pointing at provider classes that only exist under the relocated package, which breaks other mods that load adventure's services. The NeoForge build already merges service files for this reason.
@lucko
lucko merged commit 3e8745a into lucko:master Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fabric 1.10.187 ships kyori services files again crashes packetevents

2 participants