From 9767456e472821683699b9fac4bb6843390cb65d Mon Sep 17 00:00:00 2001 From: mworzala Date: Mon, 18 Dec 2023 15:09:50 +0200 Subject: [PATCH] fix: correctly save world data in PolarLoader. --- src/main/java/net/hollowcube/polar/PolarLoader.java | 1 + src/main/java/net/hollowcube/polar/PolarWorld.java | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/main/java/net/hollowcube/polar/PolarLoader.java b/src/main/java/net/hollowcube/polar/PolarLoader.java index a378373..1e1e53b 100644 --- a/src/main/java/net/hollowcube/polar/PolarLoader.java +++ b/src/main/java/net/hollowcube/polar/PolarLoader.java @@ -233,6 +233,7 @@ public boolean supportsParallelSaving() { @Override public @NotNull CompletableFuture saveInstance(@NotNull Instance instance) { + worldData.userData(NetworkBuffer.makeArray(b -> worldAccess.saveWorldData(instance, b))); return saveChunks(instance.getChunks()); } diff --git a/src/main/java/net/hollowcube/polar/PolarWorld.java b/src/main/java/net/hollowcube/polar/PolarWorld.java index 8ebd53a..e832fa7 100644 --- a/src/main/java/net/hollowcube/polar/PolarWorld.java +++ b/src/main/java/net/hollowcube/polar/PolarWorld.java @@ -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); }