Improved lightning for occluding polymer blocks using non occluding vanilla blocks - #284
Merged
Conversation
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) |
Contributor
Author
|
Yeah, I have added a I split Also fixed an issue with polymer light blocks that would miss the first forced light update (because the cached light calculation wasn't used) |
Owner
|
Seems fine enough. Let's hope it won't explode anything |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
noOcclusionproperty 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!