Adrenix/Nostalgic-Tweaks

[FABRIC/FORGE] Old Water Lighting Doesn't Spread Skylight Change

Closed this issue · 1 comments

Version Information

Please fill out the following information. Replace each x with a number:

Minecraft Version: 1.19.2
Nostalgic Tweaks Version: 2.0.0

Describe the Bug

A clear and concise description of what the bug is (e.g., startup crash, runtime crash, or something not working as intended).

Water blocks don't spread their new skylight filter to neighboring blocks.

Crash Report

If applicable, please include a link to a complete crash report. You can use Gist (https://gist.github.com) to create this link. These reports can be found in .minecraft/crash-reports.

N/a

Bug Context

If applicable, add some context to the bug. If a crash occurred while you were in-game, what happened before the crash? For example, "I fell from a high place and before the hurt sound could play the game crashed."

In the image, it looks like the air pockets are emitting light. The air blocks are not emitting light, but instead what's happening here is that the air blocks have a higher skylight value than the neighboring water blocks. This is what makes it look like the air blocks are emitting light. This happens due to the way I've implemented old water lighting.

When the game goes to retrieve a skylight value from the light engine for a water block, I swap out the skylight level with a new calculated skylight value based on what is above the water block. The problem with this is that this only applies to the water block requesting a skylight value. I don't know if it's possible to re-calculate neighboring blocks after chunk rendering. And if there is a solution to this issue, I would imagine it would require another rendering pass after creating a cache of blocks to re-render that would be impacted by water blocks using some type of flood algorithm.

There are a few things to note about any offered solution. First, the solution should keep the tweak client side. Second, if the solution comes at a performance cost, then it may be necessary to split the fix as its own tweak so that the user can decide if they're willing to live with the performance hit to avoid the visual glitch. Lastly, the solution must avoid the first implementation of this tweak.

When I first developed this tweak, I used to change the skylight filter amount saved on disk. This fixed the issue shown here, but caused other problems and wouldn't allow the tweak to work on servers without the mod installed. So I would prefer that any offered solution avoids regressing back to my original implementation.

Screenshots

If applicable, add screenshots to help explain your problem.
Image

This issue is fixed in beta 9.