-
Notifications
You must be signed in to change notification settings - Fork 32
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
Implement light update #46
Comments
Hey, I'm working on a project that would benefit from implementing light. I'm planning on working on this issue. If there is any reason I shouldn't do this. Let me know. |
It would be great if gets implemented. I am working on an RL project which requires pov image of the bot as input to take decisions and its critical that the lighting data is included for rendering |
I created a Minecraft bot that detect the light of around blocks. But when I put a torch on the ground, the "light update" was not happened. More interesting, if the bot exited the game and joined again, the "light update" was happened and everything went well. |
I think this is the right place to implement light update (skylight and blocklight) as it will be needed in mineflayer and flying-squid.
Both type of light can spread horizontally to a maximum of 15 blocks so to compute light for a chunk, the 8 chunk neighbors are needed.
We will need at a minimum 1 function that can recompute the light for the whole chunk. Then functions that are able to do only a partial computation when 1 block change can be added (if needed). The algorithm can be the same for all version, but 1.14+ have 2 additional light sections (at the top and at the bottom of the chunk).
We can implement a test by loading a vanilla chunk (and its neighbor) and comparing the computed light levels with the stored one.
Wiki: https://minecraft.gamepedia.com/Light
An implementation: https://github.com/bergerhealer/Light-Cleaner/blob/master/src/main/java/com/bergerkiller/bukkit/lightcleaner/lighting/LightingChunk.java
The text was updated successfully, but these errors were encountered: