Skip to content

Commit

Permalink
fix: correctly save world data in PolarLoader.
Browse files Browse the repository at this point in the history
  • Loading branch information
mworzala committed Dec 18, 2023
1 parent add30b0 commit 9767456
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/net/hollowcube/polar/PolarLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ public boolean supportsParallelSaving() {

@Override
public @NotNull CompletableFuture<Void> saveInstance(@NotNull Instance instance) {
worldData.userData(NetworkBuffer.makeArray(b -> worldAccess.saveWorldData(instance, b)));
return saveChunks(instance.getChunks());
}

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/net/hollowcube/polar/PolarWorld.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ public byte maxSection() {
return userData;
}

public void userData(byte @NotNull [] userData) {
this.userData = userData;
}

public @Nullable PolarChunk chunkAt(int x, int z) {
return chunks.getOrDefault(ChunkUtils.getChunkIndex(x, z), null);
}
Expand Down

0 comments on commit 9767456

Please sign in to comment.