PlotSquared icon indicating copy to clipboard operation
PlotSquared copied to clipboard

Draft: Recalculate light levels on chunk generation

Open PierreSchwang opened this issue 3 years ago • 5 comments

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

PierreSchwang avatar Mar 06 '22 12:03 PierreSchwang

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?

dordsor21 avatar Mar 07 '22 15:03 dordsor21

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

PierreSchwang avatar Mar 07 '22 15:03 PierreSchwang

A reasonable extension to this would be setting NBT data as well (https://github.com/IntellectualSites/PlotSquared/issues/3579)

dordsor21 avatar Apr 23 '22 14:04 dordsor21

At this point, it might make sense to use the new worldgen api (and fallback to the "broken" behavior on older versions)

SirYwell avatar Apr 23 '22 15:04 SirYwell

Is this now superseded / implemented by https://github.com/IntellectualSites/PlotSquared/pull/3659 and can be closed?

PierreSchwang avatar Jul 29 '22 19:07 PierreSchwang

Please take a moment and address the merge conflicts of your pull request. Thanks!

github-actions[bot] avatar Oct 22 '23 10:10 github-actions[bot]