Skip to content

Improved lightning for occluding polymer blocks using non occluding vanilla blocks - #284

Merged
Patbox merged 4 commits into
Patbox:dev/26.2from
DrexHD:improved-light
Sep 1, 2026
Merged

Improved lightning for occluding polymer blocks using non occluding vanilla blocks#284
Patbox merged 4 commits into
Patbox:dev/26.2from
DrexHD:improved-light

Conversation

@DrexHD

@DrexHD DrexHD commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

This PR attempts to patch light packet data to adjust the light values for polymer block positions to roughly match the light from surrounding blocks. This is useful for blocks solid blocks that shouldn't pass light, but use barriers (or similar) with an element holder to display the block.
Usually these blocks will display dark (after reconnecting), because the light level (which is used by the display entity) inside the block is 0.

The current "solution" for this is to add the noOcclusion property to such blocks. This does unfortunately change the actual light level on the server, which can cause unexpected changes (dirt may transform into grass while underneath these blocks). Monsters won't spawn when these blocks are used as a light blocking ceiling.

This is (and can only be) an approximation of what block light level should look like, because blocks can have different brightness on different faces, which we can't reproduce with a single display element per block!

@Patbox

Patbox commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Interesting idea, but it might make sense to do it based on polymer client block compared to the real one rather than applying it to all blocks. Also would be good to hookup the polymer's forced light updates so the lighting is always correct (if it differs from the client blocks)

@Patbox Patbox added the enhancement New feature or request label Aug 26, 2026
@DrexHD

DrexHD commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

Yeah, I have added a forceLightInsideBlock method to allow developers to choose which behavior they want.

I split PolymerBlockPosStorage, because I had to make a few changes to it and didn't want to continue adding return null methods.

Also fixed an issue with polymer light blocks that would miss the first forced light update (because the cached light calculation wasn't used)

@Patbox
Patbox merged commit d515e65 into Patbox:dev/26.2 Sep 1, 2026
1 check passed
@Patbox

Patbox commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Seems fine enough. Let's hope it won't explode anything

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants