Skip to content

Commit

Permalink
fix: save light without requiring LightingChunk (for AnvilPolar to sa…
Browse files Browse the repository at this point in the history
…ve correctly)
  • Loading branch information
mworzala committed Jul 26, 2024
1 parent 203f1f0 commit ad37c65
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/main/java/net/hollowcube/polar/PolarLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
import net.minestom.server.command.builder.arguments.minecraft.ArgumentBlockState;
import net.minestom.server.command.builder.exception.ArgumentSyntaxException;
import net.minestom.server.exception.ExceptionManager;
import net.minestom.server.instance.*;
import net.minestom.server.instance.Chunk;
import net.minestom.server.instance.IChunkLoader;
import net.minestom.server.instance.Instance;
import net.minestom.server.instance.Section;
import net.minestom.server.instance.block.Block;
import net.minestom.server.instance.block.BlockManager;
import net.minestom.server.instance.light.LightCompute;
Expand Down Expand Up @@ -365,12 +368,9 @@ private void updateChunkData(@NotNull Short2ObjectMap<String> blockCache, @NotNu
biomeData[x + z * 4 + y * 4 * 4] = paletteId;
});

byte[] blockLight = null, skyLight = null;
if (chunk instanceof LightingChunk) {
blockLight = section.blockLight().array();
skyLight = section.skyLight().array();
}

byte[] blockLight = section.blockLight().array();
byte[] skyLight = section.skyLight().array();

sections[i] = new PolarSection(
blockPalette.toArray(new String[0]), blockData,
biomePalette.toArray(new String[0]), biomeData,
Expand Down

0 comments on commit ad37c65

Please sign in to comment.