Skip to content

#22 Fix runtime loading - #185

Merged
tpwalke2 merged 2 commits into
mainfrom
bugfix/tpwalke2/22-runtime
Aug 11, 2026
Merged

#22 Fix runtime loading#185
tpwalke2 merged 2 commits into
mainfrom
bugfix/tpwalke2/22-runtime

Conversation

@tpwalke2

@tpwalke2 tpwalke2 commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Fix NoClassDefFoundError on CommandRegistrationCallback in dev server

Problem

After #22 trimmed the Fabric API dependency down to just fabric-lifecycle-events-v1 (the only module this mod's code uses), ./gradlew runServer failed with NoClassDefFoundError/ClassNotFoundException on net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback.

Root cause

BlueMap's own Fabric entrypoint (de.bluecolored.bluemap.fabric.FabricMod) uses fabric-command-api-v2 and fabric-networking-api-v1 directly. In production this is harmless — users install the full bundled "Fabric API" mod, which contains every module regardless of what BlueMapSignMarkers declares. But runServer populates its dev-environment classpath purely from this project's own Gradle dependencies, and BlueMap is dropped straight into run/mods with no dependency resolution of its own — so trimming to one module left BlueMap's other two modules missing at runtime.

Fix

  • Add fabric-command-api-v2 and fabric-networking-api-v1 as runtimeOnly dependencies in build.gradle, solely to satisfy BlueMap in the dev server. This project's own code still only depends on (and imports from) fabric-lifecycle-events-v1, so no fabric.mod.json change is needed.
  • Updates gradle from 9.5.1 to 9.6.1

Testing

  • ./gradlew build passes.
  • Confirmed the mod loads without NoClassDefFoundErrorviarunServer`.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to fix a dev-server runtime NoClassDefFoundError caused by trimming Fabric API modules too aggressively, ensuring BlueMap’s Fabric entrypoint has the Fabric API classes it expects during ./gradlew runServer.

Changes:

  • Adds fabric-command-api-v2 and fabric-networking-api-v1 as runtimeOnly dependencies to satisfy BlueMap’s dev runtime needs without expanding this mod’s compile-time API usage.
  • Updates the Gradle wrapper (distribution version and regenerated gradlew / gradlew.bat scripts).

Reviewed changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated 2 comments.

File Description
build.gradle Adds Fabric API modules as runtimeOnly to prevent dev runtime classloading failures from BlueMap’s entrypoint.
gradle/wrapper/gradle-wrapper.properties Updates Gradle distribution URL and wrapper download-related settings.
gradlew Regenerated POSIX Gradle wrapper script consistent with the wrapper update.
gradlew.bat Regenerated Windows Gradle wrapper script; includes error-path flow changes that need correction.
Suppressed comments (1)

gradlew.bat:68

  • Same issue as above: "%COMSPEC%" /c exit 1 sets ERRORLEVEL but does not terminate this batch file, so execution continues into :execute even after printing an invalid JAVA_HOME error. Terminate the script explicitly here.
"%COMSPEC%" /c exit 1

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread gradlew.bat
Comment thread gradle/wrapper/gradle-wrapper.properties
@tpwalke2
tpwalke2 merged commit 14a2f81 into main Aug 11, 2026
2 checks passed
@tpwalke2
tpwalke2 deleted the bugfix/tpwalke2/22-runtime branch August 11, 2026 10:27
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.

2 participants