Sodium-Starlight incompatiblity on 1.18
DioEgizio opened this issue ยท 6 comments
Version information
mc1.18-pre8-0.4.0+alpha4
Expected Behavior
No rendering issues, like it was on 1.17.x and 1.16.x
Actual Behavior
Sodium without starlight works and Starlight without Sodium works so I think it's an incompatibility
Error: error.txt
Reproduction Steps
- Install fabric for 1.18 rc3
- Install both starlight and sodium
- Open a World and you'll see
Java version
Java 17 (Termurin Build)
CPU
AMD Ryzen 5 3500u
GPU
AMD Radeon Vega 8
Additional information
No response
The problem is a mixin order. Sodium injects the load callback at the end of the packet handler, and I call setLightReady before it. I've set the mixin priority for Starlight to be lower so that Sodium's callback runs first.
I didn't see any other clean way of doing it either.
issue has been fixed on starlight side, so closing this issue
Original text:
It seems like Starlight tried to implement a workaround for an unofficial port of our own mod, and that the workaround causes a sanity check to fail and crash the game with the official version.
They should revert this change, and preferably not implement fixes for our mod just because of a bug in another person's fork...
Edit: This is not correct. See Spottedleaf's response below.
I'm not reverting it. It's fixing a Starlight bug, not a Sodium bug.
The actual fix was making sure starlight initialised the emptiness maps (what sections are empty), which are required for the generic get NibbleArray from sectionpos to even work (which is what sodium does on many different versions to get light data)
it just so happens only sodium reads the NibbleArray, and so the actual problem on vanilla was never seen. This was noted in the commit message, and why Sodium was mentioned at all.
@Spottedleaf Apologies. My understanding of the issue seems to have been clearly incorrect. I will re-open the issue and edit my original statement.
We should sort out what both projects are doing in this area (the load hook) and figure out something that isn't broken...
Starlight is making the runnable they queue in the packet handler immediately execute. However, it's not executing before the chunk is loaded into the client, just immediately after. So I'm not really sure what the errors in the log suggest (perhaps I am clobbering one of your hooks?)
You can find the hooks here:
https://github.com/PaperMC/Starlight/blob/fabric-dev/1.18/src/main/java/ca/spottedleaf/starlight/mixin/client/multiplayer/ClientPacketListenerMixin.java