Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't classload FluidRenderHandler on dedicated server #1529

Merged
merged 2 commits into from
Nov 12, 2024

Conversation

unilock
Copy link
Contributor

@unilock unilock commented Nov 12, 2024

The Issue

The FluidRenderHandler class is classloaded during mod init (specifically FluidHandlerCompat#initFabricFluidTypes) on dedicated servers, causing a crash due to the classloading of the client-only class TextureAtlasSprite.

The Proposal

The access to FluidRenderHandlerRegistry has been moved from FluidHandlerCompat#initFabricFluidTypes to FluidHandlerCompatClient#onRegisterClientExtensions.

Possible Side Effects

None that I can think of.

Alternatives

It's possible an @OnlyIn(Dist.CLIENT) marker somewhere might also work?

Additional Notes

See #1501 for a more complete description of the issue.

Additionally, the mixins that should only be loaded on the client have been marked as such in the .mixins.json, silencing a few warnings in the logs on dedicated servers.

Silences some warnings in dedicated server logs
@Su5eD
Copy link
Member

Su5eD commented Nov 12, 2024

Can we move the reference to the fluid render handler registry to FluidHandlerCompatClient altogether instead of temporarily storing it in the fabric fluid type? I think that'd be safer.

@Su5eD
Copy link
Member

Su5eD commented Nov 12, 2024

Seems to work as expected. Thanks for the quality PR!

@Su5eD Su5eD merged commit 20f42c7 into Sinytra:1.21.x Nov 12, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants