mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-22 10:35:38 +01:00
Update CB
This commit is contained in:
parent
98d8483c7a
commit
912ee23e25
@ -1,4 +1,4 @@
|
||||
From 58e43b6b0747683bae76a23aaa7e2846aed7aa75 Mon Sep 17 00:00:00 2001
|
||||
From 080cc0be500cf818045396a0a8f36994d387f032 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Thu, 3 Mar 2016 04:00:11 -0600
|
||||
Subject: [PATCH] Timings v2
|
||||
@ -514,10 +514,10 @@ index 9dcab42de..c1b0d6cea 100644
|
||||
this.chunkLoader.a(this.world, chunk);
|
||||
} catch (IOException ioexception) {
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
index 370f1418b..f4161b8ec 100644
|
||||
index 9655a3ceb..cdb0b1342 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
@@ -388,7 +388,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
@@ -397,7 +397,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
|
||||
public void loadEntities(Chunk chunk, NBTTagCompound nbttagcompound, World world) {
|
||||
// CraftBukkit end
|
||||
@ -526,7 +526,7 @@ index 370f1418b..f4161b8ec 100644
|
||||
NBTTagList nbttaglist1 = nbttagcompound.getList("Entities", 10);
|
||||
|
||||
for (int l = 0; l < nbttaglist1.size(); ++l) {
|
||||
@@ -397,8 +397,6 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
@@ -406,8 +406,6 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
a(nbttagcompound2, world, chunk);
|
||||
chunk.g(true);
|
||||
}
|
||||
@ -535,7 +535,7 @@ index 370f1418b..f4161b8ec 100644
|
||||
NBTTagList nbttaglist2 = nbttagcompound.getList("TileEntities", 10);
|
||||
|
||||
for (int i1 = 0; i1 < nbttaglist2.size(); ++i1) {
|
||||
@@ -409,8 +407,6 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
@@ -418,8 +416,6 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
chunk.a(tileentity);
|
||||
}
|
||||
}
|
||||
@ -544,7 +544,7 @@ index 370f1418b..f4161b8ec 100644
|
||||
|
||||
if (nbttagcompound.hasKeyOfType("TileTicks", 9)) {
|
||||
NBTTagList nbttaglist3 = nbttagcompound.getList("TileTicks", 10);
|
||||
@@ -428,7 +424,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
@@ -437,7 +433,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
world.b(new BlockPosition(nbttagcompound4.getInt("x"), nbttagcompound4.getInt("y"), nbttagcompound4.getInt("z")), block, nbttagcompound4.getInt("t"), nbttagcompound4.getInt("p"));
|
||||
}
|
||||
}
|
||||
@ -607,7 +607,7 @@ index 6f63a5a1d..3b8425915 100644
|
||||
return waitable.get();
|
||||
} catch (java.util.concurrent.ExecutionException e) {
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 6258cfd01..2b508a029 100644
|
||||
index c2da96eaf..6d47f384a 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -25,7 +25,8 @@ import org.bukkit.block.BlockFace;
|
||||
@ -1918,5 +1918,5 @@ index 2bd690fdf..38be7ed71 100644
|
||||
}
|
||||
}
|
||||
--
|
||||
2.13.0
|
||||
2.13.4
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 927dcc40693024aad07e9335f4f993d23d0f1e4e Mon Sep 17 00:00:00 2001
|
||||
From 3cf72e3346d3d809dc82f2813aa459c3a97c6467 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Fri, 4 Mar 2016 18:18:37 -0600
|
||||
Subject: [PATCH] Chunk save queue improvements
|
||||
@ -26,7 +26,7 @@ Then finally, Sleeping will by default be removed, but due to known issues with
|
||||
But if sleeps are to remain enabled, we at least lower the sleep interval so it doesn't have as much negative impact.
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
index 9a6f87e59..873ffa77d 100644
|
||||
index 36689db74..3898ad8fa 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
@@ -204,4 +204,10 @@ public class PaperConfig {
|
||||
@ -41,10 +41,10 @@ index 9a6f87e59..873ffa77d 100644
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
index 6550686ee..17005d677 100644
|
||||
index cdb0b1342..cd976f09e 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
@@ -12,14 +12,17 @@ import java.util.List;
|
||||
@@ -12,11 +12,14 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import javax.annotation.Nullable;
|
||||
@ -58,16 +58,12 @@ index 6550686ee..17005d677 100644
|
||||
+ private final Object lock = new Object(); // Paper - Chunk queue improvements
|
||||
private static final Logger a = LogManager.getLogger();
|
||||
private final Map<ChunkCoordIntPair, NBTTagCompound> b = Maps.newConcurrentMap();
|
||||
- private final Set<ChunkCoordIntPair> c = Collections.newSetFromMap(Maps.newConcurrentMap());
|
||||
+ //private final Set<ChunkCoordIntPair> c = Collections.newSetFromMap(Maps.newConcurrentMap()); // Paper - Chunk queue improvements
|
||||
private final File d;
|
||||
private final DataConverterManager e;
|
||||
private boolean f;
|
||||
@@ -134,35 +137,32 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
}
|
||||
|
||||
// CraftBukkit
|
||||
@@ -138,9 +141,10 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
protected void a(ChunkCoordIntPair chunkcoordintpair, NBTTagCompound nbttagcompound) {
|
||||
- if (!this.c.contains(chunkcoordintpair)) {
|
||||
// CraftBukkit
|
||||
// if (!this.c.contains(chunkcoordintpair))
|
||||
- {
|
||||
+ synchronized (lock) { // Paper - Chunk queue improvements
|
||||
this.b.put(chunkcoordintpair, nbttagcompound);
|
||||
}
|
||||
@ -75,40 +71,44 @@ index 6550686ee..17005d677 100644
|
||||
|
||||
FileIOThread.a().a(this);
|
||||
}
|
||||
@@ -151,8 +155,11 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
}
|
||||
|
||||
public boolean a() {
|
||||
- // CraftBukkit start
|
||||
private synchronized boolean processSaveQueueEntry(boolean logCompletion) {
|
||||
- Iterator<Map.Entry<ChunkCoordIntPair, NBTTagCompound>> iter = this.b.entrySet().iterator();
|
||||
- if (!iter.hasNext()) {
|
||||
- // CraftBukkit end
|
||||
+ // CraftBukkit start
|
||||
+ // Paper start - Chunk queue improvements
|
||||
+ QueuedChunk chunk = queue.poll();
|
||||
+ if (chunk == null) {
|
||||
+ // Paper - end
|
||||
if (this.f) {
|
||||
+ // Paper - end
|
||||
if (logCompletion) {
|
||||
// CraftBukkit end
|
||||
ChunkRegionLoader.a.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.d.getName());
|
||||
}
|
||||
@@ -160,18 +167,14 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
|
||||
return false;
|
||||
} else {
|
||||
- // CraftBukkit start
|
||||
- Map.Entry<ChunkCoordIntPair, NBTTagCompound> entry = iter.next();
|
||||
- iter.remove(); // Pop single entry
|
||||
- ChunkCoordIntPair chunkcoordintpair = entry.getKey();
|
||||
- NBTTagCompound nbttagcompound = entry.getValue();
|
||||
- // CraftBukkit end
|
||||
+ ChunkCoordIntPair chunkcoordintpair = chunk.coords; // Paper - Chunk queue improvements
|
||||
|
||||
boolean flag;
|
||||
|
||||
try {
|
||||
- this.c.add(chunkcoordintpair);
|
||||
- NBTTagCompound nbttagcompound = (NBTTagCompound) entry.getValue(); // CraftBukkit
|
||||
- // this.c.add(chunkcoordintpair);
|
||||
- // NBTTagCompound nbttagcompound = (NBTTagCompound) this.b.remove(chunkcoordintpair);
|
||||
- // CraftBukkit
|
||||
+ //this.c.add(chunkcoordintpair);
|
||||
+ //NBTTagCompound nbttagcompound = (NBTTagCompound) entry.getValue(); // CraftBukkit // Paper - Chunk queue improvements
|
||||
+ NBTTagCompound nbttagcompound = chunk.compound; // Paper - Chunk queue improvements
|
||||
|
||||
if (nbttagcompound != null) {
|
||||
try {
|
||||
@@ -171,10 +171,11 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
@@ -180,10 +183,11 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
ChunkRegionLoader.a.error("Failed to save chunk", exception);
|
||||
}
|
||||
}
|
||||
@ -116,12 +116,12 @@ index 6550686ee..17005d677 100644
|
||||
|
||||
flag = true;
|
||||
} finally {
|
||||
- this.c.remove(chunkcoordintpair);
|
||||
+ //this.c.remove(chunkcoordintpair); // Paper
|
||||
- this.b.remove(chunkcoordintpair, nbttagcompound); // CraftBukkit
|
||||
+ //this.b.remove(chunkcoordintpair, nbttagcompound); // CraftBukkit // Paper
|
||||
}
|
||||
|
||||
return flag;
|
||||
@@ -539,4 +540,16 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
@@ -548,4 +552,16 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
@ -163,5 +163,5 @@ index 1d6b1874c..9ee4115be 100644
|
||||
|
||||
if (this.b.isEmpty()) {
|
||||
--
|
||||
2.13.0
|
||||
2.13.4
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 215acca8d61ac2957f84dc40dfda8bdf6ed7b14a Mon Sep 17 00:00:00 2001
|
||||
From 7b1b6ddb0ee1c4411cb27bca78dbca5e0d4f0c70 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Mon, 4 Mar 2013 23:46:10 -0500
|
||||
Subject: [PATCH] Chunk Save Reattempt
|
||||
@ -6,10 +6,10 @@ Subject: [PATCH] Chunk Save Reattempt
|
||||
We commonly have "Stream Closed" errors on chunk saving, so this code should re-try to save the chunk in the event of failure and hopefully prevent rollbacks.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
index 8e91be4a1..721a3cd81 100644
|
||||
index cd976f09e..d1c13f00d 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
@@ -165,11 +165,16 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
@@ -177,11 +177,16 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
NBTTagCompound nbttagcompound = chunk.compound; // Paper - Chunk queue improvements
|
||||
|
||||
if (nbttagcompound != null) {
|
||||
@ -28,7 +28,7 @@ index 8e91be4a1..721a3cd81 100644
|
||||
synchronized (lock) { if (this.b.get(chunkcoordintpair) == nbttagcompound) { this.b.remove(chunkcoordintpair); } }// Paper - This will not equal if a newer version is still pending
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
|
||||
index 5f9678aad..ed840dbc9 100644
|
||||
index 6a92b5af8..5bcbd718f 100644
|
||||
--- a/src/main/java/net/minecraft/server/RegionFile.java
|
||||
+++ b/src/main/java/net/minecraft/server/RegionFile.java
|
||||
@@ -210,8 +210,7 @@ public class RegionFile {
|
||||
@ -42,5 +42,5 @@ index 5f9678aad..ed840dbc9 100644
|
||||
|
||||
}
|
||||
--
|
||||
2.12.2.windows.2
|
||||
2.13.4
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 5944c7e7b49872ffc7df3c9e183475beec1b4461 Mon Sep 17 00:00:00 2001
|
||||
From 9f62de2d9723d6ed184b539d495b8838d12955eb Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Tue, 21 Jun 2016 22:54:34 -0400
|
||||
Subject: [PATCH] Fix Double World Add issues
|
||||
@ -8,10 +8,10 @@ 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 5e9879b89..cf0a8011d 100644
|
||||
index d1c13f00d..5f999d275 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
@@ -508,7 +508,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
@@ -520,7 +520,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
}
|
||||
|
||||
public static void a(Entity entity, World world, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) {
|
||||
@ -33,5 +33,5 @@ index 91cfed1e5..5672689cf 100644
|
||||
int i = MathHelper.floor(entity.locX / 16.0D);
|
||||
int j = MathHelper.floor(entity.locZ / 16.0D);
|
||||
--
|
||||
2.13.3.windows.1
|
||||
2.13.4
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 20bd4471cb3ca3988e3ad85b31a516138b3f36a2 Mon Sep 17 00:00:00 2001
|
||||
From 8e6b3b1e301b131f570a5b91eaf71ac340b403c5 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Thu, 3 Nov 2016 21:52:22 -0400
|
||||
Subject: [PATCH] Prevent Auto Save if Save Queue is full
|
||||
@ -7,7 +7,7 @@ If the save queue already has 50 (configurable) of chunks pending,
|
||||
then avoid processing auto save (which would add more)
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index efae01b1..70b498c7 100644
|
||||
index efae01b1d..70b498c7b 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -377,6 +377,11 @@ public class PaperWorldConfig {
|
||||
@ -23,7 +23,7 @@ index efae01b1..70b498c7 100644
|
||||
private void removeCorruptTEs() {
|
||||
removeCorruptTEs = getBoolean("remove-corrupt-tile-entities", false);
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
index 39f0f5a1..19f10fed 100644
|
||||
index 067c53b12..ef194312b 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
@@ -254,6 +254,14 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
@ -51,10 +51,10 @@ index 39f0f5a1..19f10fed 100644
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
index 6b5b5e91..ceef6e45 100644
|
||||
index 3ed762f05..e90d08b0d 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
@@ -32,6 +32,8 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
@@ -34,6 +34,8 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
this.e = dataconvertermanager;
|
||||
}
|
||||
|
||||
@ -64,5 +64,5 @@ index 6b5b5e91..ceef6e45 100644
|
||||
@Nullable
|
||||
public Chunk a(World world, int i, int j) throws IOException {
|
||||
--
|
||||
2.13.1.windows.2
|
||||
2.13.4
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From a64e03a4b423c7339dacffcc1c14168d7f2aba7f Mon Sep 17 00:00:00 2001
|
||||
From 88c663c910b32ef367273b25e59a311cc6f24dd5 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Fri, 4 Nov 2016 02:12:10 -0400
|
||||
Subject: [PATCH] Chunk Save Stats Debug Option
|
||||
@ -55,10 +55,10 @@ index ef194312b..8fca62eec 100644
|
||||
return false;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
index ceef6e456..d275eb194 100644
|
||||
index 67753e0b1..ea91c0477 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
@@ -32,7 +32,13 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
@@ -34,7 +34,13 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
this.e = dataconvertermanager;
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ index ceef6e456..d275eb194 100644
|
||||
|
||||
// CraftBukkit start - Add async variant, provide compatibility
|
||||
@Nullable
|
||||
@@ -142,6 +148,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
@@ -146,6 +152,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
synchronized (lock) { // Paper - Chunk queue improvements
|
||||
this.b.put(chunkcoordintpair, nbttagcompound);
|
||||
}
|
||||
@ -81,7 +81,7 @@ index ceef6e456..d275eb194 100644
|
||||
queue.add(new QueuedChunk(chunkcoordintpair, nbttagcompound)); // Paper - Chunk queue improvements
|
||||
|
||||
FileIOThread.a().a(this);
|
||||
@@ -159,6 +166,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
@@ -170,6 +177,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
||||
return false;
|
||||
} else {
|
||||
ChunkCoordIntPair chunkcoordintpair = chunk.coords; // Paper - Chunk queue improvements
|
||||
@ -90,5 +90,5 @@ index ceef6e456..d275eb194 100644
|
||||
boolean flag;
|
||||
|
||||
--
|
||||
2.13.0
|
||||
2.13.4
|
||||
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 27b8bf91169642a61f9cf888432cf018773d7df0
|
||||
Subproject commit 963b19c5995b14f8980a42f13b1bd693a5b411d1
|
Loading…
Reference in New Issue
Block a user