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

Implement light update #46

Open
Karang opened this issue Aug 8, 2020 · 3 comments
Open

Implement light update #46

Karang opened this issue Aug 8, 2020 · 3 comments

Comments

@Karang
Copy link
Contributor

Karang commented Aug 8, 2020

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

@JeremyLakey
Copy link

JeremyLakey commented May 26, 2024

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.

@sdace9719
Copy link

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

@AkagawaTsurunaki
Copy link

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.
Therefore, I wonder if the Minecraft server can tell the client when and how the light of specific blocks should be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants