Jump to content

[1.18.2] Need to force a lighting update on a chunk


Recommended Posts

I'm working on a mod that strips away all the land of a world and leaves just the ores, floating in space. I just wanted to do it to see if I can.

I've gotten the core functionality working, by hooking into the ChunkEvent.load event, and I iterate through every block in the chunk, deleting (read: turning to air) the ones that aren't ores. I also removed the surface rules/feature placements in a datapack so I'm just working with stone, air, lava, and ores prior to the ChunkEvent.

After this process, the world displays the floating ores in a curious way- some are lit, as if by a shaft of light, and others are in pitch darkness, even though there is nothing above them. I think this is because the lighting is already determined before I remove the blocks, causing some to be in darkness as if they were in a cave. It seems like I need to force a lighting update in the chunkevent, or something along those lines, but I'm not sure how to do it. It's possible I should hook into a later event and try to instigate a global lighting update, but I don't know which one that should be.

Any help would be appreciated!

Link to comment
Share on other sites

Update on this, it's very strange but it seems like the unlit blocks are just not receiving light from the sun, despite being in clear view of it. In the debug menu I can see that they're getting 0 light from the sun, which means no matter how many times I were to update them, they'd still remain unlit. Any idea why this is?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.