Skip to content

Commit

Permalink
feat: optionally disable adding the lighting data to chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
mworzala committed Jan 6, 2024
1 parent 76344b2 commit 7299025
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/main/java/net/hollowcube/polar/PolarLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class PolarLoader implements IChunkLoader {

private PolarWorldAccess worldAccess = PolarWorldAccess.DEFAULT;
private boolean parallel = false;
private boolean loadLighting = true;

public PolarLoader(@NotNull Path path) throws IOException {
this.savePath = path;
Expand Down Expand Up @@ -96,6 +97,12 @@ public PolarLoader(@NotNull PolarWorld world) {
return this;
}

@Contract("_ -> this")
public @NotNull PolarLoader setLoadLighting(boolean loadLighting) {
this.loadLighting = loadLighting;
return this;
}

// Loading


Expand Down Expand Up @@ -205,9 +212,9 @@ private void loadSection(@NotNull PolarSection sectionData, @NotNull Section sec
}

// Light
if (sectionData.hasBlockLightData())
if (loadLighting && sectionData.hasBlockLightData())
section.setBlockLight(sectionData.blockLight());
if (sectionData.hasSkyLightData())
if (loadLighting && sectionData.hasSkyLightData())
section.setSkyLight(sectionData.skyLight());
}

Expand Down

0 comments on commit 7299025

Please sign in to comment.