Sometimes sharp difference in light level between chunk boundaries
seeruk opened this issue ยท 13 comments
Hey there - fantastic plugin, couldn't live without this functionality!
The issue is pretty much just the title. It's best explained with a screenshot. This happens above ground and in caves. I am using this with Sodium as you can probably see from the screenshot. But I have also tried it with only this mod and Fabric API and the result is the same. It seems fairly easy to reproduce for me right now.
I've noticed this occur in a more subtle way in other situations too, where when you enter a new chunk the light level changes suddenly, only quite slightly. I think it's probably the same issue, just to a lesser extent.
https://cdn.discordapp.com/attachments/461578336875970588/736265370528120913/unknown.png found an extreme example
http://prntscr.com/tnzzz3
it seems to happen on all right (left) chunk borders when facing north (south) and when you stand/walk on the last block of the chunk
Thanks for the report!
So I figured out why, it's because of the MathHelper#fastFloor
precision not being accurate enough when being in the chunk east edge in negative X-coordinates.
Now I use a much more precise value which fixes the issue :)
But something is bothering me, I can't reproduce the issue with another axis in the negative Z-coordinates.
there arent any issues on negative X? https://gyazo.com/9f220ceb110c6ce9063f13a44d949d1d
only when facing positive/negative Z https://gyazo.com/d89414d17638da4d81a975d288a92e35
https://gyazo.com/af31bbba80066bb71ee3238fafa8ed86
While trying to reproduce this I was face north, and was on the east edge of the chunk.
I only could reproduce it when the chunks was in a negative-X coordinate, not when in a positive-X coordinate.
Here's when I'm in a negative X-coordinates, facing north (or south) on the east chunk border.
And now when I'm in positive X-coordinates, facing north (or south) on the east chunk border.
The issue doesn't happen in positive X-coordinates.
I just guess that MathHelper#fastFloor
doesn't like a lot negative coordinates.
http://prntscr.com/tobzi2 found extra stuff :o
http://prntscr.com/toc04c feels like only negative coords are affected
-X is east
-Z is south
-XZ is south+east+SE
Oh so it also happens in that axis, thanks for checking!
The fix I applied in dev environment already works on that other axis ;)
Will be fixed in next release ^^
it will probably fixed along the way: https://gyazo.com/bd5c463618ee23460f8cd2a556c55732
upon stepping on the last block facing S/E/SE (depending on the coords) of a chunk the light stops moving until you enter the next chunk
the reverse also applies; moving N/W/NW (depending on which negative coord) the light lags behind 1 block when entering a new chunk
i have the feeling the mod only tracks light in a 15x15 area of a chunk instead 16x16
I can confirm that this is also fixed with the same changes.
I still have to figure out how the hell I can calculate correctly which chunks to update for Block Entities and this issue will be entirely resolved :)