[ci skip] Add more identifying patch comments

This commit is contained in:
Nassim Jahnke
2024-01-21 12:53:04 +01:00
parent f6609428b6
commit 0571a6438e
54 changed files with 166 additions and 206 deletions

View File

@@ -87,7 +87,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ ChunkHolder chunkHolder = io.papermc.paper.chunk.system.ChunkSystem.getUnloadingChunkHolder(this.level, chunkX, chunkZ);
+ return chunkHolder == null ? null : chunkHolder.getAvailableChunkNow();
+ }
+ // Paper end
+ // Paper end - Cache chunk status on disk
+
boolean anyPlayerCloseEnoughForSpawning(ChunkPos pos) {
// Spigot start
@@ -122,7 +122,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ final int location = getChunkLocation(x, z);
+ return this.statuses[location];
+ }
+ // Paper end
+ // Paper end - Cache chunk status
+
public RegionFile(Path file, Path directory, boolean dsync) throws IOException {
this(file, directory, RegionFileVersion.VERSION_DEFLATE, dsync);
@@ -131,7 +131,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return this.getOffset(pos) != 0;
}
+ private static int getChunkLocation(int x, int z) { return (x & 31) + (z & 31) * 32; } // Paper - OBFHELPER - sort of, mirror of logic below
+ private static int getChunkLocation(int x, int z) { return (x & 31) + (z & 31) * 32; } // Paper - Cache chunk status; OBFHELPER - sort of, mirror of logic below
private static int getOffsetIndex(ChunkPos pos) {
return pos.getRegionLocalX() + pos.getRegionLocalZ() * 32;
}
@@ -139,7 +139,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
synchronized (this) {
try {
// Paper end
+ this.closed = true; // Paper
+ this.closed = true; // Paper - Cache chunk status
try {
this.padToFullSector();
} finally {
@@ -151,7 +151,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
try {
NbtIo.write(nbt, (DataOutput) dataoutputstream);
+ regionfile.setStatus(pos.x, pos.z, ChunkSerializer.getStatus(nbt)); // Paper - cache status on disk
+ regionfile.setStatus(pos.x, pos.z, ChunkSerializer.getStatus(nbt)); // Paper - Cache chunk status
regionfile.setOversized(pos.x, pos.z, false); // Paper - We don't do this anymore, mojang stores differently, but clear old meta flag if it exists to get rid of our own meta file once last oversized is gone
} catch (Throwable throwable) {
if (dataoutputstream != null) {
@@ -180,8 +180,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- return this.isChunkLoaded(x, z) || this.world.getChunkSource().chunkMap.read(new ChunkPos(x, z)).get().isPresent();
- } catch (InterruptedException | ExecutionException ex) {
+ return world.getChunkSource().chunkMap.getChunkStatusOnDisk(new ChunkPos(x, z)) == ChunkStatus.FULL;
+ // Paper end
+ } catch (java.io.IOException ex) {
+ // Paper end - Fix this method
throw new RuntimeException(ex);
}
}
@@ -240,7 +240,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ world.getChunkSource().addRegionTicket(TicketType.PLUGIN, chunkPos, 1, Unit.INSTANCE);
+ world.getChunkSource().getChunk(x, z, ChunkStatus.FULL, true);
+ return true;
+ // Paper end
+ // Paper end - Optimize this method
}
@Override