PlotSquared
PlotSquared copied to clipboard
Draft: Recalculate light levels on chunk generation
Overview
Fixes #3514
Description
Applies light updates to blocks with light values on chunk generation using a populator and WorldEdits World#applySideEffects-method. Draft, as sometimes that doesn't seem to work and chunk borders sometimes have rough edges.
Submitter Checklist
- [x] Make sure you are opening from a topic branch (/feature/fix/docs/ branch (right side)) and not your main branch.
- [x] Ensure that the pull request title represents the desired changelog entry.
- [ ] I tested my changes and approved their functionality.
- [x] I ensured my changes do not break other parts of the code
- [x] I read and followed the contribution guidelines
What's the performance impact of this? Also is setting blocks via the world safe to do during the populate chunk phase, given neighbour-generation-state requirements?
What's the performance impact of this? Also is setting blocks via the world safe to do during the populate chunk phase, given neighbour-generation-state requirements?
Before caching the light blocks it was quite laggy, but after caching them when setting them and interating over them changes nothing in performance. I do update the light levels on population, therefor after the chunk generation itself. It does work as I stated, but sometimes chunk edges or blocks won't update properly
A reasonable extension to this would be setting NBT data as well (https://github.com/IntellectualSites/PlotSquared/issues/3579)
At this point, it might make sense to use the new worldgen api (and fallback to the "broken" behavior on older versions)
Is this now superseded / implemented by https://github.com/IntellectualSites/PlotSquared/pull/3659 and can be closed?
Please take a moment and address the merge conflicts of your pull request. Thanks!