|
|
|
|
@@ -8,7 +8,7 @@ Copyright xymb@endcrystal.me
|
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
|
|
diff --git a/build.gradle.kts b/build.gradle.kts
|
|
|
|
|
index 7f1f4988a25a5ebac36c25c045c51eefecab6862..09f9a12da1807dd72a95378b4824d9a09f7ccbfe 100644
|
|
|
|
|
index abfd4d5faf23511284b4efac771ef79da0ef72da..0a6549d0f545e81ae95527797333f2e2da85e1f1 100644
|
|
|
|
|
--- a/build.gradle.kts
|
|
|
|
|
+++ b/build.gradle.kts
|
|
|
|
|
@@ -13,6 +13,10 @@ dependencies {
|
|
|
|
|
@@ -76,36 +76,19 @@ index 0000000000000000000000000000000000000000..249303116d3cfadd078ebf0ae6e44bf9
|
|
|
|
|
+}
|
|
|
|
|
diff --git a/src/main/java/dev/kaiijumc/kaiiju/region/AbstractRegionFileFactory.java b/src/main/java/dev/kaiijumc/kaiiju/region/AbstractRegionFileFactory.java
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 0000000000000000000000000000000000000000..a470609b107f46ffc3bb7b121525ca8b803b4322
|
|
|
|
|
index 0000000000000000000000000000000000000000..dcfbabf54b19a4c29d5c95830242c5c26bf2f4aa
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/src/main/java/dev/kaiijumc/kaiiju/region/AbstractRegionFileFactory.java
|
|
|
|
|
@@ -0,0 +1,46 @@
|
|
|
|
|
@@ -0,0 +1,29 @@
|
|
|
|
|
+package dev.kaiijumc.kaiiju.region;
|
|
|
|
|
+
|
|
|
|
|
+import net.minecraft.world.level.chunk.storage.RegionFile;
|
|
|
|
|
+import net.minecraft.world.level.chunk.storage.RegionFileVersion;
|
|
|
|
|
+
|
|
|
|
|
+import java.io.File;
|
|
|
|
|
+import java.io.IOException;
|
|
|
|
|
+import java.nio.file.Path;
|
|
|
|
|
+
|
|
|
|
|
+public class AbstractRegionFileFactory {
|
|
|
|
|
+ public static AbstractRegionFile getAbstractRegionFile(Path file, Path directory, boolean dsync) throws IOException {
|
|
|
|
|
+ return getAbstractRegionFile(file, directory, RegionFileVersion.VERSION_DEFLATE, dsync);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public static AbstractRegionFile getAbstractRegionFile(Path file, Path directory, boolean dsync, boolean canRecalcHeader) throws IOException {
|
|
|
|
|
+ return getAbstractRegionFile(file, directory, RegionFileVersion.VERSION_DEFLATE, dsync, canRecalcHeader);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public static AbstractRegionFile getAbstractRegionFile(Path file, Path directory, RegionFileVersion outputChunkStreamVersion, boolean dsync) throws IOException {
|
|
|
|
|
+ return getAbstractRegionFile(file, directory, outputChunkStreamVersion, dsync, false);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public static AbstractRegionFile getAbstractRegionFile(Path file, Path directory, RegionFileVersion outputChunkStreamVersion, boolean dsync, boolean canRecalcHeader) throws IOException {
|
|
|
|
|
+ return getAbstractRegionFile(1, file, directory, outputChunkStreamVersion, dsync, canRecalcHeader);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public static AbstractRegionFile getAbstractRegionFile(int linearCompression, Path file, Path directory, boolean dsync) throws IOException {
|
|
|
|
|
+ return getAbstractRegionFile(linearCompression, file, directory, RegionFileVersion.VERSION_DEFLATE, dsync);
|
|
|
|
|
+ }
|
|
|
|
|
@@ -128,16 +111,15 @@ index 0000000000000000000000000000000000000000..a470609b107f46ffc3bb7b121525ca8b
|
|
|
|
|
+}
|
|
|
|
|
diff --git a/src/main/java/dev/kaiijumc/kaiiju/region/LinearRegionFile.java b/src/main/java/dev/kaiijumc/kaiiju/region/LinearRegionFile.java
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 0000000000000000000000000000000000000000..2e0d10ded886e82c09700a1c6602cd1bb9d1967e
|
|
|
|
|
index 0000000000000000000000000000000000000000..f05d6313012560c32a3ec574b7169ec8e8930282
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/src/main/java/dev/kaiijumc/kaiiju/region/LinearRegionFile.java
|
|
|
|
|
@@ -0,0 +1,342 @@
|
|
|
|
|
@@ -0,0 +1,334 @@
|
|
|
|
|
+package dev.kaiijumc.kaiiju.region;
|
|
|
|
|
+
|
|
|
|
|
+import com.github.luben.zstd.ZstdInputStream;
|
|
|
|
|
+import com.github.luben.zstd.ZstdOutputStream;
|
|
|
|
|
+import com.mojang.logging.LogUtils;
|
|
|
|
|
+import dev.kaiijumc.kaiiju.KaiijuConfig;
|
|
|
|
|
+import net.jpountz.lz4.LZ4Compressor;
|
|
|
|
|
+import net.jpountz.lz4.LZ4Factory;
|
|
|
|
|
+import net.jpountz.lz4.LZ4FastDecompressor;
|
|
|
|
|
@@ -202,28 +184,21 @@ index 0000000000000000000000000000000000000000..2e0d10ded886e82c09700a1c6602cd1b
|
|
|
|
|
+
|
|
|
|
|
+ long superBlock = rawDataStream.readLong();
|
|
|
|
|
+
|
|
|
|
|
+ if (superBlock != SUPERBLOCK) {
|
|
|
|
|
+ System.out.println(file);
|
|
|
|
|
+ System.out.println("SUPERBLOCK INVALID!");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (superBlock != SUPERBLOCK)
|
|
|
|
|
+ throw new RuntimeException("Superblock invalid: " + superBlock + " file " + file);
|
|
|
|
|
+
|
|
|
|
|
+ byte version = rawDataStream.readByte();
|
|
|
|
|
+
|
|
|
|
|
+ if (version != VERSION) {
|
|
|
|
|
+ System.out.println(file);
|
|
|
|
|
+ System.out.println("VERSION INVALID!");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (version != VERSION)
|
|
|
|
|
+ throw new RuntimeException("Version invalid: " + version + " file " + file);
|
|
|
|
|
+
|
|
|
|
|
+ rawDataStream.readLong(); // newestTimestamp
|
|
|
|
|
+ rawDataStream.readByte(); // Compression level
|
|
|
|
|
+ rawDataStream.readShort(); // Chunk count
|
|
|
|
|
+ int dataCount = rawDataStream.readInt();
|
|
|
|
|
+
|
|
|
|
|
+ if (fileLength != HEADER_SIZE + dataCount + FOOTER_SIZE) {
|
|
|
|
|
+ if (fileLength != HEADER_SIZE + dataCount + FOOTER_SIZE)
|
|
|
|
|
+ throw new IOException("File length invalid " + this.regionFile + " " + fileLength + " " + (HEADER_SIZE + dataCount + FOOTER_SIZE));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ rawDataStream.readLong(); // Data Hash
|
|
|
|
|
+ byte[] rawCompressed = new byte[dataCount];
|
|
|
|
|
@@ -609,7 +584,7 @@ index 75965afd7b4bed23a5ecf618c7f91ff5e7ffd92f..4f4a94f60c60eb8bf4214bfcfe6f963e
|
|
|
|
|
regionFile.setStatus(chunkPos.x, chunkPos.z, ChunkSerializer.getStatus(compound));
|
|
|
|
|
}
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
|
|
|
index b396a329e753f42b3878736b6b14bafda02d3744..906d394bbb80b9069645d01a319a9fab24c42288 100644
|
|
|
|
|
index a5655ebb233f1e1e1dd7f79fdd948020478928fc..9510de3b100f217e3d24e93a9f2aef601ea03fac 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
|
|
|
@@ -390,9 +390,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
|
|
|
@@ -634,18 +609,9 @@ index b396a329e753f42b3878736b6b14bafda02d3744..906d394bbb80b9069645d01a319a9fab
|
|
|
|
|
// this.entityManager = new PersistentEntitySectionManager<>(Entity.class, new ServerLevel.EntityCallbacks(), entitypersistentstorage, this.entitySliceManager); // Paper // Paper - rewrite chunk system
|
|
|
|
|
StructureTemplateManager structuretemplatemanager = minecraftserver.getStructureManager();
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java b/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java
|
|
|
|
|
index 759b125cc1251b9b4f1f443c9f70c482ef5b32f8..74bc03e43096c865bba36b15aa248b9dc3481828 100644
|
|
|
|
|
index 759b125cc1251b9b4f1f443c9f70c482ef5b32f8..728198d0584ab8d6ae80853850cf67ac262ef93a 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java
|
|
|
|
|
@@ -41,7 +41,7 @@ import net.minecraft.world.level.chunk.storage.RegionFile;
|
|
|
|
|
import net.minecraft.world.level.dimension.LevelStem;
|
|
|
|
|
import net.minecraft.world.level.storage.DimensionDataStorage;
|
|
|
|
|
import net.minecraft.world.level.storage.LevelStorageSource;
|
|
|
|
|
-import org.slf4j.Logger;
|
|
|
|
|
+import org.bukkit.Bukkit;import org.bukkit.craftbukkit.CraftWorld;import org.slf4j.Logger;
|
|
|
|
|
|
|
|
|
|
public class WorldUpgrader {
|
|
|
|
|
|
|
|
|
|
@@ -61,7 +61,7 @@ public class WorldUpgrader {
|
|
|
|
|
private volatile int skipped;
|
|
|
|
|
private final Object2FloatMap<ResourceKey<LevelStem>> progressMap = Object2FloatMaps.synchronize(new Object2FloatOpenCustomHashMap(Util.identityStrategy())); // CraftBukkit
|
|
|
|
|
@@ -655,7 +621,7 @@ index 759b125cc1251b9b4f1f443c9f70c482ef5b32f8..74bc03e43096c865bba36b15aa248b9d
|
|
|
|
|
private final DimensionDataStorage overworldDataStorage;
|
|
|
|
|
|
|
|
|
|
public WorldUpgrader(LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, Registry<LevelStem> dimensionOptionsRegistry, boolean eraseCache) {
|
|
|
|
|
@@ -115,8 +115,11 @@ public class WorldUpgrader {
|
|
|
|
|
@@ -115,8 +115,12 @@ public class WorldUpgrader {
|
|
|
|
|
while (iterator1.hasNext()) {
|
|
|
|
|
ResourceKey<LevelStem> resourcekey1 = (ResourceKey) iterator1.next(); // CraftBukkit
|
|
|
|
|
Path path = this.levelStorage.getDimensionPath((ResourceKey) null); // CraftBukkit
|
|
|
|
|
@@ -663,13 +629,14 @@ index 759b125cc1251b9b4f1f443c9f70c482ef5b32f8..74bc03e43096c865bba36b15aa248b9d
|
|
|
|
|
- builder1.put(resourcekey1, new ChunkStorage(path.resolve("region"), this.dataFixer, true));
|
|
|
|
|
+ // Kaiiju start
|
|
|
|
|
+ String worldName = this.levelStorage.getLevelId();
|
|
|
|
|
+ String formatName = ((CraftWorld) Bukkit.getWorld(worldName)).getHandle().kaiijuConfig.regionFormatName;
|
|
|
|
|
+ builder1.put(resourcekey1, new ChunkStorage(formatName, 6, path.resolve("region"), this.dataFixer, true));
|
|
|
|
|
+ String formatName = ((org.bukkit.craftbukkit.CraftWorld) org.bukkit.Bukkit.getWorld(worldName)).getHandle().kaiijuConfig.regionFormatName;
|
|
|
|
|
+ int linearCompression = ((org.bukkit.craftbukkit.CraftWorld) org.bukkit.Bukkit.getWorld(worldName)).getHandle().kaiijuConfig.regionFormatLinearCompressionLevel;
|
|
|
|
|
+ builder1.put(resourcekey1, new ChunkStorage(formatName, linearCompression, path.resolve("region"), this.dataFixer, true));
|
|
|
|
|
+ // Kaiiju end
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ImmutableMap<ResourceKey<LevelStem>, ChunkStorage> immutablemap1 = builder1.build(); // CraftBukkit
|
|
|
|
|
@@ -235,7 +238,7 @@ public class WorldUpgrader {
|
|
|
|
|
@@ -235,7 +239,7 @@ public class WorldUpgrader {
|
|
|
|
|
File file = this.levelStorage.getDimensionPath((ResourceKey) null).toFile(); // CraftBukkit
|
|
|
|
|
File file1 = new File(file, "region");
|
|
|
|
|
File[] afile = file1.listFiles((file2, s) -> {
|
|
|
|
|
@@ -678,12 +645,16 @@ index 759b125cc1251b9b4f1f443c9f70c482ef5b32f8..74bc03e43096c865bba36b15aa248b9d
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (afile == null) {
|
|
|
|
|
@@ -254,7 +257,7 @@ public class WorldUpgrader {
|
|
|
|
|
@@ -254,7 +258,11 @@ public class WorldUpgrader {
|
|
|
|
|
int l = Integer.parseInt(matcher.group(2)) << 5;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
- RegionFile regionfile = new RegionFile(file2.toPath(), file1.toPath(), true);
|
|
|
|
|
+ dev.kaiijumc.kaiiju.region.AbstractRegionFile regionfile = dev.kaiijumc.kaiiju.region.AbstractRegionFileFactory.getAbstractRegionFile(file2.toPath(), file1.toPath(), true); // Kaiiju
|
|
|
|
|
+ // Kaiiju start
|
|
|
|
|
+ String worldName = this.levelStorage.getLevelId();
|
|
|
|
|
+ int linearCompression = ((org.bukkit.craftbukkit.CraftWorld) org.bukkit.Bukkit.getWorld(worldName)).getHandle().kaiijuConfig.regionFormatLinearCompressionLevel;
|
|
|
|
|
+ dev.kaiijumc.kaiiju.region.AbstractRegionFile regionfile = dev.kaiijumc.kaiiju.region.AbstractRegionFileFactory.getAbstractRegionFile(linearCompression, file2.toPath(), file1.toPath(), true);
|
|
|
|
|
+ // Kaiiju end
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
for (int i1 = 0; i1 < 32; ++i1) {
|
|
|
|
|
@@ -783,7 +754,7 @@ index dcfe090c269d4cbcc2eb1b6f85392848bb34656c..d42c320179ae055b8675d1ce6ce1788e
|
|
|
|
|
try (DataInputStream out = new DataInputStream(new java.io.BufferedInputStream(new InflaterInputStream(Files.newInputStream(file))))) {
|
|
|
|
|
return NbtIo.read((java.io.DataInput) out);
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
|
|
|
|
index bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f65a2188d 100644
|
|
|
|
|
index bd502ca721de0cab438d995efa00ad0554c0d2fe..04420204eef868d35491b61e95c04d6d2ce3cbad 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
|
|
|
|
@@ -22,17 +22,25 @@ public class RegionFileStorage implements AutoCloseable {
|
|
|
|
|
@@ -825,7 +796,7 @@ index bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -62,49 +70,66 @@ public class RegionFileStorage implements AutoCloseable {
|
|
|
|
|
@@ -62,49 +70,68 @@ public class RegionFileStorage implements AutoCloseable {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -889,6 +860,8 @@ index bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f
|
|
|
|
|
+ };
|
|
|
|
|
+ path1 = path.resolve("r." + j + "." + chunkcoordintpair.getRegionZ() + "." + extension);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (dev.kaiijumc.kaiiju.KaiijuConfig.regionFormatDebug)
|
|
|
|
|
+ org.bukkit.Bukkit.getLogger().info("[Region File Storage] Opening file " + path1 + " with format " + this.format + " (existingOnly = " + existingOnly + " )");
|
|
|
|
|
+ //if (existingOnly && !java.nio.file.Files.exists(path1)) return null; // CraftBukkit
|
|
|
|
|
+ // Kaiiju end
|
|
|
|
|
+
|
|
|
|
|
@@ -903,7 +876,7 @@ index bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f
|
|
|
|
|
}
|
|
|
|
|
// Paper end
|
|
|
|
|
return regionfile1;
|
|
|
|
|
@@ -132,7 +157,7 @@ public class RegionFileStorage implements AutoCloseable {
|
|
|
|
|
@@ -132,7 +159,7 @@ public class RegionFileStorage implements AutoCloseable {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -912,7 +885,7 @@ index bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f
|
|
|
|
|
synchronized (regionfile) {
|
|
|
|
|
try (DataInputStream datainputstream = regionfile.getChunkDataInputStream(chunkCoordinate)) {
|
|
|
|
|
CompoundTag oversizedData = regionfile.getOversizedData(chunkCoordinate.x, chunkCoordinate.z);
|
|
|
|
|
@@ -179,14 +204,14 @@ public class RegionFileStorage implements AutoCloseable {
|
|
|
|
|
@@ -179,14 +206,14 @@ public class RegionFileStorage implements AutoCloseable {
|
|
|
|
|
@Nullable
|
|
|
|
|
public CompoundTag read(ChunkPos pos) throws IOException {
|
|
|
|
|
// CraftBukkit start - SPIGOT-5680: There's no good reason to preemptively create files on read, save that for writing
|
|
|
|
|
@@ -929,7 +902,7 @@ index bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f
|
|
|
|
|
// We add the regionfile parameter to avoid the potential deadlock (on fileLock) if we went back to obtain a regionfile
|
|
|
|
|
// if we decide to re-read
|
|
|
|
|
// Paper end
|
|
|
|
|
@@ -196,7 +221,7 @@ public class RegionFileStorage implements AutoCloseable {
|
|
|
|
|
@@ -196,7 +223,7 @@ public class RegionFileStorage implements AutoCloseable {
|
|
|
|
|
|
|
|
|
|
// Paper start
|
|
|
|
|
if (regionfile.isOversized(pos.x, pos.z)) {
|
|
|
|
|
@@ -938,7 +911,7 @@ index bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f
|
|
|
|
|
return readOversizedChunk(regionfile, pos);
|
|
|
|
|
}
|
|
|
|
|
// Paper end
|
|
|
|
|
@@ -210,12 +235,12 @@ public class RegionFileStorage implements AutoCloseable {
|
|
|
|
|
@@ -210,12 +237,12 @@ public class RegionFileStorage implements AutoCloseable {
|
|
|
|
|
if (this.isChunkData) {
|
|
|
|
|
ChunkPos chunkPos = ChunkSerializer.getChunkCoordinate(nbttagcompound);
|
|
|
|
|
if (!chunkPos.equals(pos)) {
|
|
|
|
|
@@ -954,7 +927,7 @@ index bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -249,13 +274,13 @@ public class RegionFileStorage implements AutoCloseable {
|
|
|
|
|
@@ -249,13 +276,13 @@ public class RegionFileStorage implements AutoCloseable {
|
|
|
|
|
|
|
|
|
|
return nbttagcompound;
|
|
|
|
|
} finally { // Paper start
|
|
|
|
|
@@ -970,7 +943,7 @@ index bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f
|
|
|
|
|
if (regionfile == null) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
@@ -285,7 +310,7 @@ public class RegionFileStorage implements AutoCloseable {
|
|
|
|
|
@@ -285,7 +312,7 @@ public class RegionFileStorage implements AutoCloseable {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void write(ChunkPos pos, @Nullable CompoundTag nbt) throws IOException {
|
|
|
|
|
@@ -979,7 +952,7 @@ index bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f
|
|
|
|
|
if (nbt == null && regionfile == null) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
@@ -335,7 +360,7 @@ public class RegionFileStorage implements AutoCloseable {
|
|
|
|
|
@@ -335,7 +362,7 @@ public class RegionFileStorage implements AutoCloseable {
|
|
|
|
|
}
|
|
|
|
|
// Paper end
|
|
|
|
|
} finally { // Paper start
|
|
|
|
|
@@ -988,7 +961,7 @@ index bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f
|
|
|
|
|
} // Paper end
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -344,7 +369,7 @@ public class RegionFileStorage implements AutoCloseable {
|
|
|
|
|
@@ -344,7 +371,7 @@ public class RegionFileStorage implements AutoCloseable {
|
|
|
|
|
ObjectIterator objectiterator = this.regionCache.values().iterator();
|
|
|
|
|
|
|
|
|
|
while (objectiterator.hasNext()) {
|
|
|
|
|
@@ -997,7 +970,7 @@ index bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
regionfile.close();
|
|
|
|
|
@@ -360,7 +385,7 @@ public class RegionFileStorage implements AutoCloseable {
|
|
|
|
|
@@ -360,7 +387,7 @@ public class RegionFileStorage implements AutoCloseable {
|
|
|
|
|
ObjectIterator objectiterator = this.regionCache.values().iterator();
|
|
|
|
|
|
|
|
|
|
while (objectiterator.hasNext()) {
|
|
|
|
|
@@ -1022,7 +995,7 @@ index d783072bc964e45c308197e6f79874eb4a09f871..261613054a4ba0e78ad1aec819d743ea
|
|
|
|
|
this.factory = factory;
|
|
|
|
|
this.fixerUpper = dataFixer;
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
|
|
|
index 9b5323edd99848b73ea0e34230e7bec8dc23be8c..619c7713d573e8f438ea23a3fcb185a98abf5100 100644
|
|
|
|
|
index 6a327616cd590b70170f8441c003a2109640201d..2ef0a41fd9ee60bc0866cf5c678498c68250689c 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
|
|
|
@@ -552,7 +552,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
|
|
|
|
|