Begin remigrate to Shiroha

uhm
This commit is contained in:
2026-07-14 11:32:51 +08:00
parent 5661499e95
commit 576a9a44c8
60 changed files with 379 additions and 379 deletions
@@ -13,10 +13,10 @@ index a814512fcfb85312474ae2c2c21443843bf57831..5734af81b1f88fde952f498059c79116
public boolean moonrise$doesRegionFileNotExistNoIO(final int chunkX, final int chunkZ);
- public RegionFile moonrise$getRegionFileIfLoaded(final int chunkX, final int chunkZ);
+ public moe.monnairealms.camellia.data.RegionFile moonrise$getRegionFileIfLoaded(final int chunkX, final int chunkZ); // Camellia - Configurable region file format
+ public moe.monnairealms.camellia.data.RegionFile moonrise$getRegionFileIfLoaded(final int chunkX, final int chunkZ); // Shiroha - Configurable region file format
- public RegionFile moonrise$getRegionFileIfExists(final int chunkX, final int chunkZ) throws IOException;
+ public moe.monnairealms.camellia.data.RegionFile moonrise$getRegionFileIfExists(final int chunkX, final int chunkZ) throws IOException; // Camellia - Configurable region file format
+ public moe.monnairealms.camellia.data.RegionFile moonrise$getRegionFileIfExists(final int chunkX, final int chunkZ) throws IOException; // Shiroha - Configurable region file format
public MoonriseRegionFileIO.RegionDataController.WriteData moonrise$startWrite(
final int chunkX, final int chunkZ, final CompoundTag compound
@@ -29,7 +29,7 @@ index 3bb9b58ee97464687e348e23b99159226415c267..b6d4d9fac961aa4672ef2f4a19e2ae18
// Paper start - flush regionfiles on save
if (this.world.paperConfig().chunks.flushRegionsOnSave) {
- final RegionFile regionFile = this.regionDataController.getCache().moonrise$getRegionFileIfLoaded(this.chunkX, this.chunkZ);
+ final moe.monnairealms.camellia.data.RegionFile regionFile = this.regionDataController.getCache().moonrise$getRegionFileIfLoaded(this.chunkX, this.chunkZ); // Camellia - Configurable region file format
+ final moe.monnairealms.camellia.data.RegionFile regionFile = this.regionDataController.getCache().moonrise$getRegionFileIfLoaded(this.chunkX, this.chunkZ); // Shiroha - Configurable region file format
if (regionFile != null) {
regionFile.flush();
} // else: evicted from cache, which should have called flush
@@ -38,7 +38,7 @@ index 3bb9b58ee97464687e348e23b99159226415c267..b6d4d9fac961aa4672ef2f4a19e2ae18
public static interface IORunnable {
- public void run(final RegionFile regionFile) throws IOException;
+ public void run(final moe.monnairealms.camellia.data.RegionFile regionFile) throws IOException; // Camellia - Configurable region file format
+ public void run(final moe.monnairealms.camellia.data.RegionFile regionFile) throws IOException; // Shiroha - Configurable region file format
}
}
@@ -51,7 +51,7 @@ index 51c126735ace8fdde89ad97b5cab62f244212db0..084b64dbaa2807fa29e4ae787144fce2
public void moonrise$setWriteOnClose(final boolean value);
- public void moonrise$write(final RegionFile regionFile) throws IOException;
+ public void moonrise$write(final moe.monnairealms.camellia.data.RegionFile regionFile) throws IOException; // Camellia - Configurable region file format
+ public void moonrise$write(final moe.monnairealms.camellia.data.RegionFile regionFile) throws IOException; // Shiroha - Configurable region file format
}
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
index e305fd5850d333eb1a30572076b6475e4428f7a7..78e9cf21fb5487e5eeec04e589c2a84c1e6b06af 100644
@@ -62,11 +62,11 @@ index e305fd5850d333eb1a30572076b6475e4428f7a7..78e9cf21fb5487e5eeec04e589c2a84c
for (ServerLevel level : this.getAllLevels()) {
String storageName = level.getChunkSource().chunkMap.getStorageName();
- LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", LEGACY_WORLD_NAMES_FOR_REALMS_LOG.getOrDefault(storageName, storageName));
+ LOGGER.info("ThreadedChunkStorage ({}): All chunks are saved", LEGACY_WORLD_NAMES_FOR_REALMS_LOG.getOrDefault(storageName, storageName)); // Camellia - Configurable region format
+ LOGGER.info("ThreadedChunkStorage ({}): All chunks are saved", LEGACY_WORLD_NAMES_FOR_REALMS_LOG.getOrDefault(storageName, storageName)); // Shiroha - Configurable region format
}
- LOGGER.info("ThreadedAnvilChunkStorage: All dimensions are saved");
+ LOGGER.info("ThreadedChunkStorage: All dimensions are saved"); // Camellia - configurable region format
+ LOGGER.info("ThreadedChunkStorage: All dimensions are saved"); // Shiroha - configurable region format
}
return result;
@@ -79,7 +79,7 @@ index a7f2cfa9277c898038f6b9e0a3401db51012b64c..d6151f308e2e5864b6525409761aa6d9
import net.minecraft.world.level.chunk.storage.RegionFile;
-public record FileToUpgrade(RegionFile file, List<ChunkPos> chunksToUpgrade) {
+public record FileToUpgrade(moe.monnairealms.camellia.data.RegionFile file, List<ChunkPos> chunksToUpgrade) { // Camellia - Configurable region file format
+public record FileToUpgrade(moe.monnairealms.camellia.data.RegionFile file, List<ChunkPos> chunksToUpgrade) { // Shiroha - Configurable region file format
}
diff --git a/net/minecraft/util/worldupdate/RegionStorageUpgrader.java b/net/minecraft/util/worldupdate/RegionStorageUpgrader.java
index b228cd6c54e8c8998923ab332882d99092769c67..13ec3d38ffb6e0e87db621c9607c9dc3c6a7b31b 100644
@@ -90,7 +90,7 @@ index b228cd6c54e8c8998923ab332882d99092769c67..13ec3d38ffb6e0e87db621c9607c9dc3
private static final Logger LOGGER = LogUtils.getLogger();
private static final String NEW_DIRECTORY_PREFIX = "new_";
- private static final Pattern REGEX = Pattern.compile("^r\\.(-?[0-9]+)\\.(-?[0-9]+)\\.mca$");
+ private static final Pattern REGEX = Pattern.compile("^r\\.(-?[0-9]+)\\.(-?[0-9]+)\\." + moe.monnairealms.camellia.config.modules.function.RegionFormatConfig.regionFormat.getArgument() + "$"); // Camellia - Configurable region file format
+ private static final Pattern REGEX = Pattern.compile("^r\\.(-?[0-9]+)\\.(-?[0-9]+)\\." + moe.monnairealms.camellia.config.modules.function.RegionFormatConfig.regionFormat.getArgument() + "$"); // Shiroha - Configurable region file format
private final DataFixer dataFixer;
private final UpgradeProgress upgradeProgress;
private final String type;
@@ -99,8 +99,8 @@ index b228cd6c54e8c8998923ab332882d99092769c67..13ec3d38ffb6e0e87db621c9607c9dc3
List<ChunkPos> chunkPositions = Lists.newArrayList();
- try (RegionFile regionSource = new RegionFile(info, regionFile.toPath(), regionFolder, true)) {
+ var regionFileInfo = new moe.monnairealms.camellia.utils.RegionCreatorInfo(info, regionFile.toPath(), regionFolder, true); // Camellia - Configurable region file format
+ try (moe.monnairealms.camellia.data.RegionFile regionSource = moe.monnairealms.camellia.config.modules.function.RegionFormatConfig.regionFormat.getCreator().newFile(regionFileInfo)) { // Camellia - Configurable region file format
+ var regionFileInfo = new moe.monnairealms.camellia.utils.RegionCreatorInfo(info, regionFile.toPath(), regionFolder, true); // Shiroha - Configurable region file format
+ try (moe.monnairealms.camellia.data.RegionFile regionSource = moe.monnairealms.camellia.config.modules.function.RegionFormatConfig.regionFormat.getCreator().newFile(regionFileInfo)) { // Shiroha - Configurable region file format
for (int x = 0; x < 32; x++) {
for (int z = 0; z < 32; z++) {
ChunkPos pos = new ChunkPos(x + xOffset, z + zOffset);
@@ -109,7 +109,7 @@ index b228cd6c54e8c8998923ab332882d99092769c67..13ec3d38ffb6e0e87db621c9607c9dc3
}
- private void onFileFinished(final RegionFile regionFile) {
+ private void onFileFinished(final moe.monnairealms.camellia.data.RegionFile regionFile) { // Camellia - Configurable region file format
+ private void onFileFinished(final moe.monnairealms.camellia.data.RegionFile regionFile) { // Shiroha - Configurable region file format
if (this.recreateRegionFiles) {
if (this.previousWriteFuture != null) {
this.previousWriteFuture.join();
@@ -122,7 +122,7 @@ index 3de7fd2b084c38e72d7a6bc416880a881f514ad3..476aa2af20caeb8da293bd9e6c7467e3
import org.slf4j.Logger;
-public class RegionFile implements AutoCloseable, ca.spottedleaf.moonrise.patches.chunk_system.storage.ChunkSystemRegionFile { // Paper - rewrite chunk system
+public class RegionFile implements AutoCloseable, ca.spottedleaf.moonrise.patches.chunk_system.storage.ChunkSystemRegionFile , moe.monnairealms.camellia.data.RegionFile{ // Paper - rewrite chunk system // Camellia - Configurable region file format
+public class RegionFile implements AutoCloseable, ca.spottedleaf.moonrise.patches.chunk_system.storage.ChunkSystemRegionFile , moe.monnairealms.camellia.data.RegionFile{ // Paper - rewrite chunk system // Shiroha - Configurable region file format
private static final Logger LOGGER = LogUtils.getLogger();
public static final int MAX_CHUNK_SIZE = 500 * 1024 * 1024; // Paper - don't write garbage data to disk if writing serialization fails
private static final int SECTOR_BYTES = 4096;
@@ -131,7 +131,7 @@ index 3de7fd2b084c38e72d7a6bc416880a881f514ad3..476aa2af20caeb8da293bd9e6c7467e3
}
- boolean recalculateHeader() throws IOException {
+ public boolean recalculateHeader() throws IOException { // Camellia - Configurable region file format
+ public boolean recalculateHeader() throws IOException { // Shiroha - Configurable region file format
if (!this.canRecalcHeader) {
return false;
}
@@ -140,7 +140,7 @@ index 3de7fd2b084c38e72d7a6bc416880a881f514ad3..476aa2af20caeb8da293bd9e6c7467e3
}
- protected synchronized void write(final ChunkPos pos, final ByteBuffer data) throws IOException {
+ public synchronized void write(final ChunkPos pos, final ByteBuffer data) throws IOException { // Camellia - Configurable region file format
+ public synchronized void write(final ChunkPos pos, final ByteBuffer data) throws IOException { // Shiroha - Configurable region file format
int offsetIndex = getOffsetIndex(pos);
int offset = this.offsets.get(offsetIndex);
int sectorNumber = getSectorNumber(offset);
@@ -149,7 +149,7 @@ index 3de7fd2b084c38e72d7a6bc416880a881f514ad3..476aa2af20caeb8da293bd9e6c7467e3
@Override
- public final void moonrise$write(final RegionFile regionFile) throws IOException {
+ public final void moonrise$write(final moe.monnairealms.camellia.data.RegionFile regionFile) throws IOException { // Camellia - Configurable region file format
+ public final void moonrise$write(final moe.monnairealms.camellia.data.RegionFile regionFile) throws IOException { // Shiroha - Configurable region file format
regionFile.write(this.pos, ByteBuffer.wrap(this.buf, 0, this.count));
}
// Paper end - rewrite chunk system
@@ -158,12 +158,12 @@ index 3de7fd2b084c38e72d7a6bc416880a881f514ad3..476aa2af20caeb8da293bd9e6c7467e3
}
- synchronized boolean isOversized(int x, int z) {
+ public synchronized boolean isOversized(int x, int z) { // Camellia - Configurable region file format
+ public synchronized boolean isOversized(int x, int z) { // Shiroha - Configurable region file format
return this.oversized[getChunkIndex(x, z)] == 1;
}
- synchronized void setOversized(int x, int z, boolean oversized) throws IOException {
+ public synchronized void setOversized(int x, int z, boolean oversized) throws IOException { // Camellia - Configurable region file format
+ public synchronized void setOversized(int x, int z, boolean oversized) throws IOException { // Shiroha - Configurable region file format
final int offset = getChunkIndex(x, z);
boolean previous = this.oversized[offset] == 1;
this.oversized[offset] = (byte) (oversized ? 1 : 0);
@@ -172,7 +172,7 @@ index 3de7fd2b084c38e72d7a6bc416880a881f514ad3..476aa2af20caeb8da293bd9e6c7467e3
}
- synchronized net.minecraft.nbt.CompoundTag getOversizedData(int x, int z) throws IOException {
+ public synchronized net.minecraft.nbt.CompoundTag getOversizedData(int x, int z) throws IOException { // Camellia - Configurable region file format
+ public synchronized net.minecraft.nbt.CompoundTag getOversizedData(int x, int z) throws IOException { // Shiroha - Configurable region file format
Path file = getOversizedFile(x, z);
try (DataInputStream out = new DataInputStream(new java.io.BufferedInputStream(new java.util.zip.InflaterInputStream(Files.newInputStream(file))))) {
return net.minecraft.nbt.NbtIo.read((java.io.DataInput) out);
@@ -185,7 +185,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
public static final String ANVIL_EXTENSION = ".mca";
private static final int MAX_CACHE_SIZE = 256;
- private final Long2ObjectLinkedOpenHashMap<RegionFile> regionCache = new Long2ObjectLinkedOpenHashMap<>();
+ private final Long2ObjectLinkedOpenHashMap<moe.monnairealms.camellia.data.RegionFile> regionCache = new Long2ObjectLinkedOpenHashMap<>(); // Camellia - Configurable region file format
+ private final Long2ObjectLinkedOpenHashMap<moe.monnairealms.camellia.data.RegionFile> regionCache = new Long2ObjectLinkedOpenHashMap<>(); // Shiroha - Configurable region file format
private final RegionStorageInfo info;
private final Path folder;
private final boolean sync;
@@ -194,7 +194,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
public static ChunkPos getRegionFileCoordinates(Path file) {
String fileName = file.getFileName().toString();
- if (!fileName.startsWith("r.") || !fileName.endsWith(".mca")) {
+ if (!fileName.startsWith("r.") || !fileName.endsWith(getExtensionName())) { // Camellia - Configurable region file format
+ if (!fileName.startsWith("r.") || !fileName.endsWith(getExtensionName())) { // Shiroha - Configurable region file format
return null;
}
@@ -203,9 +203,9 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
private final it.unimi.dsi.fastutil.longs.LongLinkedOpenHashSet nonExistingRegionFiles = new it.unimi.dsi.fastutil.longs.LongLinkedOpenHashSet();
private static String getRegionFileName(final int chunkX, final int chunkZ) {
- return "r." + (chunkX >> REGION_SHIFT) + "." + (chunkZ >> REGION_SHIFT) + ".mca";
+ return "r." + (chunkX >> REGION_SHIFT) + "." + (chunkZ >> REGION_SHIFT) + getExtensionName(); // Camellia - Configurable region file format
+ return "r." + (chunkX >> REGION_SHIFT) + "." + (chunkZ >> REGION_SHIFT) + getExtensionName(); // Shiroha - Configurable region file format
}
+ // Camellia start - Configurable region file format
+ // Shiroha start - Configurable region file format
+ public static moe.monnairealms.camellia.data.RegionFile createNew(RegionStorageInfo info, Path filePath, Path folder, boolean sync) throws IOException{
+ final moe.monnairealms.camellia.enums.EnumRegionFormat regionFormat = moe.monnairealms.camellia.config.modules.function.RegionFormatConfig.regionFormat;
+ final String fullFileName = filePath.getFileName().toString();
@@ -228,7 +228,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
+ public static String getExtensionName() {
+ return "." + moe.monnairealms.camellia.config.modules.function.RegionFormatConfig.regionFormat.getArgument();
+ }
+ // Camellia end
+ // Shiroha end
private boolean doesRegionFilePossiblyExist(final long position) {
synchronized (this.nonExistingRegionFiles) {
@@ -237,17 +237,17 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
@Override
- public synchronized final RegionFile moonrise$getRegionFileIfLoaded(final int chunkX, final int chunkZ) {
+ public synchronized final moe.monnairealms.camellia.data.RegionFile moonrise$getRegionFileIfLoaded(final int chunkX, final int chunkZ) { // Camellia - Configurable region file format
+ public synchronized final moe.monnairealms.camellia.data.RegionFile moonrise$getRegionFileIfLoaded(final int chunkX, final int chunkZ) { // Shiroha - Configurable region file format
return this.regionCache.getAndMoveToFirst(ChunkPos.pack(chunkX >> REGION_SHIFT, chunkZ >> REGION_SHIFT));
}
@Override
- public synchronized final RegionFile moonrise$getRegionFileIfExists(final int chunkX, final int chunkZ) throws IOException {
+ public synchronized final moe.monnairealms.camellia.data.RegionFile moonrise$getRegionFileIfExists(final int chunkX, final int chunkZ) throws IOException { // Camellia - Configurable region file format
+ public synchronized final moe.monnairealms.camellia.data.RegionFile moonrise$getRegionFileIfExists(final int chunkX, final int chunkZ) throws IOException { // Shiroha - Configurable region file format
final long key = ChunkPos.pack(chunkX >> REGION_SHIFT, chunkZ >> REGION_SHIFT);
- RegionFile ret = this.regionCache.getAndMoveToFirst(key);
+ moe.monnairealms.camellia.data.RegionFile ret = this.regionCache.getAndMoveToFirst(key); // Camellia - Configurable region file format
+ moe.monnairealms.camellia.data.RegionFile ret = this.regionCache.getAndMoveToFirst(key); // Shiroha - Configurable region file format
if (ret != null) {
return ret;
}
@@ -256,7 +256,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
FileUtil.createDirectoriesSafe(this.folder);
- ret = new RegionFile(this.info, regionPath, this.folder, this.sync);
+ ret = this.createNew(this.info, regionPath, this.folder, this.sync); // Camellia - Configurable region file format
+ ret = this.createNew(this.info, regionPath, this.folder, this.sync); // Shiroha - Configurable region file format
this.regionCache.putAndMoveToFirst(key, ret);
@@ -265,7 +265,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
final ChunkPos pos = new ChunkPos(chunkX, chunkZ);
- final RegionFile regionFile = this.getRegionFile(pos);
+ final moe.monnairealms.camellia.data.RegionFile regionFile = this.getRegionFile(pos); // Camellia - Configurable region file format
+ final moe.monnairealms.camellia.data.RegionFile regionFile = this.getRegionFile(pos); // Shiroha - Configurable region file format
// note: not required to keep regionfile loaded after this call, as the write param takes a regionfile as input
// (and, the regionfile parameter is unused for writing until the write call)
@@ -274,7 +274,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
final ChunkPos pos = new ChunkPos(chunkX, chunkZ);
if (writeData.result() == ca.spottedleaf.moonrise.patches.chunk_system.io.MoonriseRegionFileIO.RegionDataController.WriteData.WriteResult.DELETE) {
- final RegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ);
+ final moe.monnairealms.camellia.data.RegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ); // Camellia - Configurable region file format
+ final moe.monnairealms.camellia.data.RegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ); // Shiroha - Configurable region file format
if (regionFile != null) {
regionFile.clear(pos);
} // else: didn't exist
@@ -283,7 +283,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
final int chunkX, final int chunkZ
) throws IOException {
- final RegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ);
+ final moe.monnairealms.camellia.data.RegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ); // Camellia - Configurable region file format
+ final moe.monnairealms.camellia.data.RegionFile regionFile = this.moonrise$getRegionFileIfExists(chunkX, chunkZ); // Shiroha - Configurable region file format
final DataInputStream input = regionFile == null ? null : regionFile.getChunkDataInputStream(new ChunkPos(chunkX, chunkZ));
@@ -292,7 +292,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
final ChunkPos pos = new ChunkPos(chunkX, chunkZ);
final ChunkPos headerChunkPos = SerializableChunkData.getChunkCoordinate(ret);
- final RegionFile regionFile = this.getRegionFile(pos);
+ final moe.monnairealms.camellia.data.RegionFile regionFile = this.getRegionFile(pos); // Camellia - Configurable region file format
+ final moe.monnairealms.camellia.data.RegionFile regionFile = this.getRegionFile(pos); // Shiroha - Configurable region file format
if (regionFile.getRecalculateCount() != readData.recalculateCount()) {
return null;
@@ -301,7 +301,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
// Paper end - rewrite chunk system
// Paper start - rewrite chunk system
- public RegionFile getRegionFile(ChunkPos pos) throws IOException {
+ public moe.monnairealms.camellia.data.RegionFile getRegionFile(ChunkPos pos) throws IOException { // Camellia - Configurable region file format
+ public moe.monnairealms.camellia.data.RegionFile getRegionFile(ChunkPos pos) throws IOException { // Shiroha - Configurable region file format
return this.getRegionFile(pos, false);
}
// Paper end - rewrite chunk system
@@ -310,7 +310,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
}
- @org.jetbrains.annotations.Contract("_, false -> !null") private @Nullable RegionFile getRegionFile(final ChunkPos pos, boolean existingOnly) throws IOException { // CraftBukkit
+ @org.jetbrains.annotations.Contract("_, false -> !null") private moe.monnairealms.camellia.data.RegionFile getRegionFile(final ChunkPos pos, boolean existingOnly) throws IOException { // CraftBukkit // Camellia - Configurable region file format
+ @org.jetbrains.annotations.Contract("_, false -> !null") private moe.monnairealms.camellia.data.RegionFile getRegionFile(final ChunkPos pos, boolean existingOnly) throws IOException { // CraftBukkit // Shiroha - Configurable region file format
// Paper start - rewrite chunk system
if (existingOnly) {
return this.moonrise$getRegionFileIfExists(pos.x(), pos.z());
@@ -319,7 +319,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
final long key = ChunkPos.pack(pos.x() >> REGION_SHIFT, pos.z() >> REGION_SHIFT);
- RegionFile ret = this.regionCache.getAndMoveToFirst(key);
+ moe.monnairealms.camellia.data.RegionFile ret = this.regionCache.getAndMoveToFirst(key); // Camellia - Configurable region file format
+ moe.monnairealms.camellia.data.RegionFile ret = this.regionCache.getAndMoveToFirst(key); // Shiroha - Configurable region file format
if (ret != null) {
return ret;
}
@@ -328,7 +328,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
FileUtil.createDirectoriesSafe(this.folder);
- ret = new RegionFile(this.info, regionPath, this.folder, this.sync);
+ ret = this.createNew(this.info, regionPath, this.folder, this.sync); // Camellia - Configurable region file format
+ ret = this.createNew(this.info, regionPath, this.folder, this.sync); // Shiroha - Configurable region file format
this.regionCache.putAndMoveToFirst(key, ret);
@@ -337,7 +337,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
}
- private static CompoundTag readOversizedChunk(RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException {
+ private static CompoundTag readOversizedChunk(moe.monnairealms.camellia.data.RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException { // Camellia - Configurable region file format
+ private static CompoundTag readOversizedChunk(moe.monnairealms.camellia.data.RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException { // Shiroha - Configurable region file format
synchronized (regionfile) {
try (DataInputStream datainputstream = regionfile.getChunkDataInputStream(chunkCoordinate)) {
CompoundTag oversizedData = regionfile.getOversizedData(chunkCoordinate.x(), chunkCoordinate.z());
@@ -346,7 +346,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
public @Nullable CompoundTag read(final ChunkPos pos) throws IOException {
// CraftBukkit start - SPIGOT-5680: There's no good reason to preemptively create files on read, save that for writing
- RegionFile region = this.getRegionFile(pos, true);
+ moe.monnairealms.camellia.data.RegionFile region = this.getRegionFile(pos, true); // Camellia - Configurable region file format
+ moe.monnairealms.camellia.data.RegionFile region = this.getRegionFile(pos, true); // Shiroha - Configurable region file format
if (region == null) {
return null;
}
@@ -355,7 +355,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
public void scanChunk(final ChunkPos pos, final StreamTagVisitor scanner) throws IOException {
// CraftBukkit start - SPIGOT-5680: There's no good reason to preemptively create files on read, save that for writing
- RegionFile region = this.getRegionFile(pos, true);
+ moe.monnairealms.camellia.data.RegionFile region = this.getRegionFile(pos, true); // Camellia - Configurable region file format
+ moe.monnairealms.camellia.data.RegionFile region = this.getRegionFile(pos, true); // Shiroha - Configurable region file format
if (region == null) {
return;
}
@@ -364,7 +364,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
public void write(final ChunkPos pos, final @Nullable CompoundTag value) throws IOException {
if (!SharedConstants.DEBUG_DONT_SAVE_WORLD) {
- RegionFile region = this.getRegionFile(pos, value == null); // CraftBukkit // Paper - rewrite chunk system
+ moe.monnairealms.camellia.data.RegionFile region = this.getRegionFile(pos, value == null); // CraftBukkit // Paper - rewrite chunk system // Camellia - Configurable region file format
+ moe.monnairealms.camellia.data.RegionFile region = this.getRegionFile(pos, value == null); // CraftBukkit // Paper - rewrite chunk system // Shiroha - Configurable region file format
// Paper start - rewrite chunk system
if (region == null) {
// if the RegionFile doesn't exist, no point in deleting from it
@@ -373,7 +373,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
synchronized (this) {
final ExceptionCollector<IOException> exceptionCollector = new ExceptionCollector<>();
- for (final RegionFile regionFile : this.regionCache.values()) {
+ for (final moe.monnairealms.camellia.data.RegionFile regionFile : this.regionCache.values()) { // Camellia - Configurable region file format
+ for (final moe.monnairealms.camellia.data.RegionFile regionFile : this.regionCache.values()) { // Shiroha - Configurable region file format
try {
regionFile.close();
} catch (final IOException ex) {
@@ -382,7 +382,7 @@ index 63b40c420030d935bb81a219fb33defe0946e21f..cc9913016c6d985644f8af47986db770
synchronized (this) {
final ExceptionCollector<IOException> exceptionCollector = new ExceptionCollector<>();
- for (final RegionFile regionFile : this.regionCache.values()) {
+ for (final moe.monnairealms.camellia.data.RegionFile regionFile : this.regionCache.values()) { // Camellia - Configurable region file format
+ for (final moe.monnairealms.camellia.data.RegionFile regionFile : this.regionCache.values()) { // Shiroha - Configurable region file format
try {
regionFile.flush();
} catch (final IOException ex) {