Skip to content

Add option to skip light data in Chunk#getChunkSnapshot #10099

@egg82

Description

@egg82

Is your feature request related to a problem?

If you're capturing chunk snapshots and only want to get block data from them (which seems like it would be fairly common) then having each snapshot perform light calculations every snapshot leaves performance on the table.

Describe the solution you'd like.

A performLightCalculations/doLightCalculations/etc boolean to the end of the existing public ChunkSnapshot getChunkSnapshot(boolean includeMaxBlockY, boolean includeBiome, boolean includeBiomeTempRain) method which would skip the light calculation section. A Preonditions.checkState call inside of CraftChunkSnapshot (similar to CraftChunkSnapshot#getHighestBlockYAt) would also likely be needed.

Describe alternatives you've considered.

A viable alternative would be to iterate through a chunk's blocks and capture their data the "old-fashioned" way. Chunk snapshots are supposed to make that process easier and more efficient, however - especially when doing processing off the main thread.

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.type: featureRequest for a new Feature.
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions