Repository navigation
Fix Fabric dedicated server client class linkage - #745
Merged
Merged
Conversation
st0x0ef
requested changes
Sep 10, 2026
| ClientLevelRenderEvent.AFTER_TRANSLUCENT_BLOCKS.invoker().render(new LevelSubmitContextImpl(context))); | ||
| LevelRenderEvents.END_MAIN.register(context -> | ||
| ClientLevelRenderEvent.AFTER_TRANSLUCENT_PARTICLES.invoker().render(new LevelSubmitContextImpl(context))); | ||
| ClientEventHandlerImpl.registerClient(); |
Collaborator
There was a problem hiding this comment.
We should probably remove this completely and move the call to a new ClientEventHandler.
| import net.minecraft.resources.Identifier; | ||
|
|
||
| @Environment(EnvType.CLIENT) | ||
| final class ClientEventHandlerImpl { |
Collaborator
There was a problem hiding this comment.
You can't use Impl if you don't have a base class. In this case it could be good to create one.
st0x0ef
approved these changes
Sep 10, 2026
st0x0ef
left a comment
Collaborator
There was a problem hiding this comment.
Looks good, thanks for your contribution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #744.
Fabric dedicated servers can fail during Architectury common initialization because client callback lambdas on the shared event implementation reference client-only classes. Move those registrations into a client-only implementation, dispatched through a common
ClientEventHandlerplatform declaration under the existing client environment guard. SharedEventHandlerImplno longer contains a client registration method. NeoForge retains its existing automatic client event subscribers and empty platform registration behavior.Verification
Results below apply to revision
ce6de36a8f9daf78c696c9e28b7aea4f71ede706unless noted otherwise.NO-SOURCE).Doneand shuts down cleanly: Minecraft 26.2, Loader 0.19.5, Fabric API 0.160.0+26.2, Java 25.Done (4.677s), acceptsstop, saves, and exits 0.Done (4.574s), acceptsstop, saves all dimensions, and exits 0 with no Java process remaining.:testmod-neoforge:runClient, NeoForge 26.2.0.82, Zulu 25.0.4: startup, resource loading, singleplayer world join, and client/server join callbacks pass. See shutdown limitation below. This was a development run, not an installed production-client test.The previous revision also passed full-pack Fabric dedicated-server startup; the revised dedicated-server tests above use isolated minimal environments.
Runtime caveats
ServerWatchdogunavailable afterModule minecraft has been closed. Logs and a thread dump were preserved, then the leftover process was terminated, making the Gradle run exit nonzero. This is not a clean process-exit pass. No baseline comparison has established whether this behavior is related to this PR.kqueue.Nativeinitialization exception (Only supported on OSX/BSD) before continuing toDoneand clean shutdown. The stack had no Architectury frames; ownership has not been established.Source and platform checks
An independent Astra High code review found no actionable regression. The extracted Fabric registration body is unchanged apart from whitespace, initialization ordering and the existing guard are preserved, and NeoForge automatic subscribers are unchanged. This is AI-assisted source/bytecode review, not maintainer approval or additional runtime coverage.
The revised bridge follows Architectury Plugin's existing
@ExpectPlatformconvention; no plugin change is required by this fix. Both packaged platform targets were checked. Separate documentation clarifications are staged in the docs fork; no docs PR has been opened, and those changes are not a dependency of this PR.Released 21.1.8 reproduction
A fresh download from https://modrinth.com/mod/architectury-api/version/21.1.8+fabric reproduces the failure on a production dedicated server before any client connects.
mods:architectury-fabric-21.1.8.jarandfabric-api-0.160.0+26.2.jar.java -Xms512M -Xmx1G -jar server.jar noguiusing the Fabric production server launcher (installer 1.1.2), with the EULA accepted.a266a90b68e9a051c4c83f40568a875944350b2a026ead87a2b056b067465156(identical to the originally tested artifact).The same released JAR also fails common initialization in an isolated Ubuntu 24.04.5 / WSL2 production server with Temurin 25.0.4.1+1 and the same two-mod set:
Neither released-JAR server reaches
Done. The minimal Windows server reportsClientLevel; the WSL server reportsAbstractLevelRenderContext; the original full-pack failure reportedLocalPlayer. The WSL comparison also changes JVM vendor/version, so it does not isolate the operating system as the only variable. No minimal client/server pair with released 21.1.8 was tested; the failure occurs during server startup independently of a client.