mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
Forgot to rebuild patches after I fixed things in upstream update
This commit is contained in:
parent
2041815962
commit
d039f43117
8 changed files with 34 additions and 12 deletions
|
@ -1071,7 +1071,7 @@ index 56c3783412..f3d9211baa 100644
|
|||
this.initLighting();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
index 90e6de419e..538e4b04d9 100644
|
||||
index 93bc613958..31faeb43f6 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
|
|
|
@ -54,7 +54,7 @@ index 87744dcbfc..355186c111 100644
|
|||
return false;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
index 3283b5047d..110c9ef520 100644
|
||||
index 2415404d69..f099b91f7a 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
|
@ -77,11 +77,11 @@ index 3283b5047d..110c9ef520 100644
|
|||
|
||||
protected void a(ChunkCoordIntPair chunkcoordintpair, Supplier<NBTTagCompound> nbttagcompound) { // Spigot
|
||||
+ queuedSaves++; // Paper
|
||||
synchronized (this.queue) { // Paper - synchronize while modifying the map
|
||||
synchronized (this.b) { // Paper - synchronize while modifying the map
|
||||
queue.add(new QueuedChunk(chunkcoordintpair, nbttagcompound)); // Paper - Chunk queue improvements
|
||||
this.b.put(chunkcoordintpair, nbttagcompound);
|
||||
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
} else {
|
||||
// Paper end
|
||||
ChunkCoordIntPair chunkcoordintpair = chunk.coords; // Paper - Chunk queue improvements
|
||||
Supplier<NBTTagCompound> nbttagcompound = chunk.compoundSupplier; // Spigot // Paper
|
||||
+ processedSaves.incrementAndGet(); // Paper
|
||||
|
|
|
@ -41,7 +41,7 @@ index 0d68ffd75a..fd00c320ce 100644
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
index 2e9bd0949a..3166d4b1ad 100644
|
||||
index 2e9bd0949a..1dbcedbf94 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
@@ -0,0 +0,0 @@ import java.util.function.Consumer;
|
||||
|
@ -60,6 +60,13 @@ index 2e9bd0949a..3166d4b1ad 100644
|
|||
+ private static class QueuedChunk {
|
||||
+ public ChunkCoordIntPair coords;
|
||||
+ public Supplier<NBTTagCompound> compoundSupplier;
|
||||
+ public Runnable onSave;
|
||||
+
|
||||
+ public QueuedChunk(Runnable run) {
|
||||
+ this.coords = null;
|
||||
+ this.compoundSupplier = null;
|
||||
+ this.onSave = run;
|
||||
+ }
|
||||
+
|
||||
+ public QueuedChunk(ChunkCoordIntPair coords, Supplier<NBTTagCompound> compoundSupplier) {
|
||||
+ this.coords = coords;
|
||||
|
@ -88,7 +95,7 @@ index 2e9bd0949a..3166d4b1ad 100644
|
|||
|
||||
protected void a(ChunkCoordIntPair chunkcoordintpair, Supplier<NBTTagCompound> nbttagcompound) { // Spigot
|
||||
- this.b.put(chunkcoordintpair, nbttagcompound);
|
||||
+ synchronized (this.queue) { // Paper - synchronize while modifying the map
|
||||
+ synchronized (this.b) { // Paper - synchronize while modifying the map
|
||||
+ queue.add(new QueuedChunk(chunkcoordintpair, nbttagcompound)); // Paper - Chunk queue improvements
|
||||
+ this.b.put(chunkcoordintpair, nbttagcompound);
|
||||
+ }
|
||||
|
@ -117,6 +124,12 @@ index 2e9bd0949a..3166d4b1ad 100644
|
|||
- iterator.remove();
|
||||
- ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair) entry.getKey();
|
||||
- Supplier<NBTTagCompound> nbttagcompound = (Supplier<NBTTagCompound>) entry.getValue(); // Spigot
|
||||
+ // Paper start
|
||||
+ if (chunk.onSave != null) {
|
||||
+ chunk.onSave.run();
|
||||
+ return true;
|
||||
+ }
|
||||
+ // Paper end
|
||||
+ ChunkCoordIntPair chunkcoordintpair = chunk.coords; // Paper - Chunk queue improvements
|
||||
+ Supplier<NBTTagCompound> nbttagcompound = chunk.compoundSupplier; // Spigot // Paper
|
||||
|
||||
|
@ -127,7 +140,7 @@ index 2e9bd0949a..3166d4b1ad 100644
|
|||
RegionFileCache.write(this.c, chunkcoordintpair.x, chunkcoordintpair.z, SupplierUtils.getIfExists(nbttagcompound)); // Spigot
|
||||
|
||||
+ // Paper start remove from map only if this was the latest version of the chunk
|
||||
+ synchronized (this.queue) {
|
||||
+ synchronized (this.b) {
|
||||
+ // This will not equal if a newer version is still pending - wait until newest is saved to remove
|
||||
+ if (this.b.get(chunkcoordintpair) == chunk.compoundSupplier) {
|
||||
+ this.b.remove(chunkcoordintpair);
|
||||
|
@ -137,6 +150,15 @@ index 2e9bd0949a..3166d4b1ad 100644
|
|||
/*
|
||||
NBTCompressedStreamTools.a(nbttagcompound, (DataOutput) dataoutputstream);
|
||||
dataoutputstream.close();
|
||||
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
- } // CraftBukkit
|
||||
+ // } // CraftBukkit // Paper
|
||||
}
|
||||
|
||||
private ChunkStatus.Type a(@Nullable NBTTagCompound nbttagcompound) {
|
||||
diff --git a/src/main/java/net/minecraft/server/FileIOThread.java b/src/main/java/net/minecraft/server/FileIOThread.java
|
||||
index a3aba244af..97917551a4 100644
|
||||
--- a/src/main/java/net/minecraft/server/FileIOThread.java
|
||||
|
|
|
@ -8,7 +8,7 @@ the loadChunk method refuses to acknoledge they exists, and will restart
|
|||
a new chunk generation process to begin with, so saving them serves no benefit.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
index 110c9ef520..3074aa50e8 100644
|
||||
index f099b91f7a..ec94b9fe57 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
|
|
|
@ -8,7 +8,7 @@ Vanilla will double add Spider Jockeys to the world, so ignore already added.
|
|||
Also add debug if something else tries to, and abort before world gets bad state
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
index 3166d4b1ad..1c5b7903cc 100644
|
||||
index 1dbcedbf94..8e14f8c56c 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
|
|
|
@ -41,7 +41,7 @@ index 7a972f4187..87744dcbfc 100644
|
|||
Chunk chunk = (Chunk) objectiterator.next();
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
index fde80d1fd3..3283b5047d 100644
|
||||
index 8e14f8c56c..2415404d69 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
|
|
|
@ -18,7 +18,7 @@ an invalid entity.
|
|||
This should reduce log occurrences of dupe uuid messages.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
index 4f0571ae26..b0fa23db5e 100644
|
||||
index ec94b9fe57..e6ede2cc25 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
|
|
|
@ -59,7 +59,7 @@ index bcdf4f91d8..c457d07110 100644
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
index ffa94ea674..68a3169c31 100644
|
||||
index e6ede2cc25..93bc613958 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
|
|
Loading…
Reference in a new issue