Updated Upstream (Paper)

Upstream has released updates that appears to apply and compile correctly

Paper Changes:
42daaadd Seperate out incremental saving
3a713bd5 Mark entities as being ticked when notifying navigation
6f709200 use getChunkImmediately for vehicles
This commit is contained in:
William Blake Galbreath
2019-07-27 21:46:21 -05:00
parent fecf837b13
commit 6fb364e8e0
4 changed files with 37 additions and 36 deletions

2
Paper

Submodule Paper updated: fe7ef7b5d6...42daaaddf6

View File

@@ -1 +1 @@
1.14.4--6ebebe7734fb8cde4af5985aea01c6db0787a1a8 1.14.4--5c426c33197a887ccae88317c3dfaf4107997678

View File

@@ -1,4 +1,4 @@
From 905033baaaa9459c844b87cd0ab60dac6bd677a6 Mon Sep 17 00:00:00 2001 From c68ca6c7499e4109fc8ba1cdf3a9b7611cfed7c1 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com> From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Sat, 13 Jul 2019 09:23:10 -0700 Date: Sat, 13 Jul 2019 09:23:10 -0700
Subject: [PATCH] Asynchronous chunk IO and loading Subject: [PATCH] Asynchronous chunk IO and loading
@@ -140,7 +140,7 @@ and some poi tasks).
.../net/minecraft/server/MinecraftServer.java | 1 + .../net/minecraft/server/MinecraftServer.java | 1 +
.../net/minecraft/server/NibbleArray.java | 1 + .../net/minecraft/server/NibbleArray.java | 1 +
.../net/minecraft/server/PlayerChunk.java | 8 +- .../net/minecraft/server/PlayerChunk.java | 8 +-
.../net/minecraft/server/PlayerChunkMap.java | 294 +++++++- .../net/minecraft/server/PlayerChunkMap.java | 296 +++++++-
.../java/net/minecraft/server/RegionFile.java | 2 +- .../java/net/minecraft/server/RegionFile.java | 2 +-
.../net/minecraft/server/RegionFileCache.java | 6 +- .../net/minecraft/server/RegionFileCache.java | 6 +-
.../minecraft/server/RegionFileSection.java | 56 +- .../minecraft/server/RegionFileSection.java | 56 +-
@@ -148,7 +148,7 @@ and some poi tasks).
.../net/minecraft/server/VillagePlace.java | 66 +- .../net/minecraft/server/VillagePlace.java | 66 +-
.../net/minecraft/server/WorldServer.java | 77 +- .../net/minecraft/server/WorldServer.java | 77 +-
.../org/bukkit/craftbukkit/CraftWorld.java | 36 +- .../org/bukkit/craftbukkit/CraftWorld.java | 36 +-
28 files changed, 2786 insertions(+), 90 deletions(-) 28 files changed, 2787 insertions(+), 91 deletions(-)
create mode 100644 src/main/java/com/destroystokyo/paper/io/ConcreteFileIOThread.java create mode 100644 src/main/java/com/destroystokyo/paper/io/ConcreteFileIOThread.java
create mode 100644 src/main/java/com/destroystokyo/paper/io/IOUtil.java create mode 100644 src/main/java/com/destroystokyo/paper/io/IOUtil.java
create mode 100644 src/main/java/com/destroystokyo/paper/io/PrioritizedTaskQueue.java create mode 100644 src/main/java/com/destroystokyo/paper/io/PrioritizedTaskQueue.java
@@ -2271,7 +2271,7 @@ index 0000000000..03cb8e0b32
+ +
+} +}
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index d714b8d01b..27c884b6e4 100644 index 2c6a164f02..64a899abc8 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -124,11 +124,137 @@ public class ChunkProviderServer extends IChunkProvider { @@ -124,11 +124,137 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -2803,7 +2803,7 @@ index 23d1935dd5..14f8b61042 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index ab2c002bc1..57b1dd4145 100644 index c954cccce4..aeff82fbd4 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -774,6 +774,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas @@ -774,6 +774,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@@ -2853,7 +2853,7 @@ index af934ef8bc..8d18d9dd0f 100644
completablefuture = (CompletableFuture) this.statusFutures.get(i); completablefuture = (CompletableFuture) this.statusFutures.get(i);
if (completablefuture != null) { if (completablefuture != null) {
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 8aa610bae0..7d2808aa29 100644 index fd0d2b6e67..4c774e31dc 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -62,7 +62,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -62,7 +62,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -2891,16 +2891,16 @@ index 8aa610bae0..7d2808aa29 100644
this.n.close(); this.n.close();
super.close(); super.close();
} }
@@ -340,7 +341,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -313,7 +314,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
shouldSave = ((Chunk) ichunkaccess).lastSaved + world.paperConfig.autoSavePeriod <= world.getTime(); shouldSave = ((Chunk) ichunkaccess).lastSaved + world.paperConfig.autoSavePeriod <= world.getTime();
} }
- if (shouldSave && this.saveChunk(ichunkaccess)) { - if (shouldSave && this.saveChunk(ichunkaccess)) {
+ if (shouldSave && this.saveChunk(ichunkaccess, true)) { // Paper - async chunk io + if (shouldSave && this.saveChunk(ichunkaccess, true)) { // Paper - async chunk io
++savedThisTick; ++savedThisTick;
playerchunk.m(); playerchunk.m();
} }
@@ -360,11 +361,15 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -373,11 +374,15 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
protected void unloadChunks(BooleanSupplier booleansupplier) { protected void unloadChunks(BooleanSupplier booleansupplier) {
GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler(); GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler();
@@ -2916,7 +2916,7 @@ index 8aa610bae0..7d2808aa29 100644
} }
gameprofilerfiller.exit(); gameprofilerfiller.exit();
@@ -405,6 +410,60 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -418,6 +423,60 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
} }
@@ -2977,7 +2977,7 @@ index 8aa610bae0..7d2808aa29 100644
private void a(long i, PlayerChunk playerchunk) { private void a(long i, PlayerChunk playerchunk) {
CompletableFuture<IChunkAccess> completablefuture = playerchunk.getChunkSave(); CompletableFuture<IChunkAccess> completablefuture = playerchunk.getChunkSave();
Consumer<IChunkAccess> consumer = (ichunkaccess) -> { // CraftBukkit - decompile error Consumer<IChunkAccess> consumer = (ichunkaccess) -> { // CraftBukkit - decompile error
@@ -418,13 +477,20 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -431,13 +490,20 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
((Chunk) ichunkaccess).setLoaded(false); ((Chunk) ichunkaccess).setLoaded(false);
} }
@@ -2999,7 +2999,7 @@ index 8aa610bae0..7d2808aa29 100644
this.lightEngine.a(ichunkaccess.getPos()); this.lightEngine.a(ichunkaccess.getPos());
this.lightEngine.queueUpdate(); this.lightEngine.queueUpdate();
this.worldLoadListener.a(ichunkaccess.getPos(), (ChunkStatus) null); this.worldLoadListener.a(ichunkaccess.getPos(), (ChunkStatus) null);
@@ -494,26 +560,30 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -507,26 +573,30 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
} }
} }
@@ -3020,11 +3020,7 @@ index 8aa610bae0..7d2808aa29 100644
+ if (ioThrowable != null) { + if (ioThrowable != null) {
+ com.destroystokyo.paper.io.IOUtil.rethrow(ioThrowable); + com.destroystokyo.paper.io.IOUtil.rethrow(ioThrowable);
} }
+ this.getVillagePlace().loadInData(chunkcoordintpair, chunkHolder.poiData); -
+ chunkHolder.tasks.forEach(Runnable::run);
+ // Paper - async load completes this
+ // Paper end
- if (nbttagcompound != null) { - if (nbttagcompound != null) {
- boolean flag = nbttagcompound.hasKeyOfType("Level", 10) && nbttagcompound.getCompound("Level").hasKeyOfType("Status", 8); - boolean flag = nbttagcompound.hasKeyOfType("Level", 10) && nbttagcompound.getCompound("Level").hasKeyOfType("Status", 8);
- -
@@ -3036,6 +3032,11 @@ index 8aa610bae0..7d2808aa29 100644
- } - }
- -
- PlayerChunkMap.LOGGER.error("Chunk file at {} is missing level data, skipping", chunkcoordintpair); - PlayerChunkMap.LOGGER.error("Chunk file at {} is missing level data, skipping", chunkcoordintpair);
+ this.getVillagePlace().loadInData(chunkcoordintpair, chunkHolder.poiData);
+ chunkHolder.tasks.forEach(Runnable::run);
+ // Paper - async load completes this
+ // Paper end
+
+ // Paper start - This is done async + // Paper start - This is done async
+ if (chunkHolder.protoChunk != null) { + if (chunkHolder.protoChunk != null) {
+ chunkHolder.protoChunk.setLastSaved(this.world.getTime()); + chunkHolder.protoChunk.setLastSaved(this.world.getTime());
@@ -3045,7 +3046,7 @@ index 8aa610bae0..7d2808aa29 100644
} catch (ReportedException reportedexception) { } catch (ReportedException reportedexception) {
Throwable throwable = reportedexception.getCause(); Throwable throwable = reportedexception.getCause();
@@ -527,7 +597,27 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -540,7 +610,27 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
} }
return Either.left(new ProtoChunk(chunkcoordintpair, ChunkConverter.a, this.world)); // Paper - Anti-Xray return Either.left(new ProtoChunk(chunkcoordintpair, ChunkConverter.a, this.world)); // Paper - Anti-Xray
@@ -3074,7 +3075,7 @@ index 8aa610bae0..7d2808aa29 100644
} }
private CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> b(PlayerChunk playerchunk, ChunkStatus chunkstatus) { private CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> b(PlayerChunk playerchunk, ChunkStatus chunkstatus) {
@@ -733,18 +823,43 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -746,18 +836,43 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
return this.v.get(); return this.v.get();
} }
@@ -3126,7 +3127,7 @@ index 8aa610bae0..7d2808aa29 100644
ichunkaccess.setLastSaved(this.world.getTime()); ichunkaccess.setLastSaved(this.world.getTime());
ichunkaccess.setNeedsSaving(false); ichunkaccess.setNeedsSaving(false);
@@ -755,27 +870,33 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -768,27 +883,33 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
NBTTagCompound nbttagcompound; NBTTagCompound nbttagcompound;
if (chunkstatus.getType() != ChunkStatus.Type.LEVELCHUNK) { if (chunkstatus.getType() != ChunkStatus.Type.LEVELCHUNK) {
@@ -3163,7 +3164,7 @@ index 8aa610bae0..7d2808aa29 100644
} }
protected void setViewDistance(int i) { protected void setViewDistance(int i) {
@@ -879,6 +1000,42 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -892,6 +1013,42 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
} }
} }
@@ -3206,7 +3207,7 @@ index 8aa610bae0..7d2808aa29 100644
@Nullable @Nullable
public NBTTagCompound readChunkData(ChunkCoordIntPair chunkcoordintpair) throws IOException { // Paper - private -> public public NBTTagCompound readChunkData(ChunkCoordIntPair chunkcoordintpair) throws IOException { // Paper - private -> public
NBTTagCompound nbttagcompound = this.read(chunkcoordintpair); NBTTagCompound nbttagcompound = this.read(chunkcoordintpair);
@@ -901,12 +1058,42 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -914,12 +1071,42 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
// Paper start - chunk status cache "api" // Paper start - chunk status cache "api"
public ChunkStatus getChunkStatusOnDiskIfCached(ChunkCoordIntPair chunkPos) { public ChunkStatus getChunkStatusOnDiskIfCached(ChunkCoordIntPair chunkPos) {
@@ -3249,7 +3250,7 @@ index 8aa610bae0..7d2808aa29 100644
RegionFile regionFile = this.getRegionFile(chunkPos, false); RegionFile regionFile = this.getRegionFile(chunkPos, false);
if (!regionFile.chunkExists(chunkPos)) { if (!regionFile.chunkExists(chunkPos)) {
@@ -918,18 +1105,56 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -931,18 +1118,56 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
if (status != null) { if (status != null) {
return status; return status;
} }
@@ -3308,7 +3309,7 @@ index 8aa610bae0..7d2808aa29 100644
public IChunkAccess getUnloadingChunk(int chunkX, int chunkZ) { public IChunkAccess getUnloadingChunk(int chunkX, int chunkZ) {
PlayerChunk chunkHolder = this.pendingUnload.get(ChunkCoordIntPair.pair(chunkX, chunkZ)); PlayerChunk chunkHolder = this.pendingUnload.get(ChunkCoordIntPair.pair(chunkX, chunkZ));
return chunkHolder == null ? null : chunkHolder.getAvailableChunkNow(); return chunkHolder == null ? null : chunkHolder.getAvailableChunkNow();
@@ -1277,6 +1502,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -1290,6 +1515,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
} }
@@ -3601,7 +3602,7 @@ index b0e6ad773e..f6c95ae8c1 100644
} }
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 917fbb35b4..dc710b2fbd 100644 index e160b0aa59..ba4f7999f9 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java --- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@

View File

@@ -1,4 +1,4 @@
From 01d5f91c38f2f0136371f0a6bfc024c70c594809 Mon Sep 17 00:00:00 2001 From 13cceab96a020767c5cbc232a147d50faa77610e Mon Sep 17 00:00:00 2001
From: kickash32 <kickash32@gmail.com> From: kickash32 <kickash32@gmail.com>
Date: Tue, 11 Jun 2019 22:22:16 -0400 Date: Tue, 11 Jun 2019 22:22:16 -0400
Subject: [PATCH] implement optional per player mob spawns Subject: [PATCH] implement optional per player mob spawns
@@ -29,10 +29,10 @@ index 318a470eea..72b77e27e8 100644
private void countAllMobsForSpawning() { private void countAllMobsForSpawning() {
countAllMobsForSpawning = getBoolean("count-all-mobs-for-spawning", false); countAllMobsForSpawning = getBoolean("count-all-mobs-for-spawning", false);
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index ed0ff8573b..b3936caf45 100644 index b1bea8f90d..d92446d79b 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -592,9 +592,21 @@ public class ChunkProviderServer extends IChunkProvider { @@ -601,9 +601,21 @@ public class ChunkProviderServer extends IChunkProvider {
// Paper start - only allow spawns upto the limit per chunk and update count afterwards // Paper start - only allow spawns upto the limit per chunk and update count afterwards
int currEntityCount = object2intmap.getInt(enumcreaturetype); int currEntityCount = object2intmap.getInt(enumcreaturetype);
int difference = k1 - currEntityCount; int difference = k1 - currEntityCount;
@@ -69,7 +69,7 @@ index d92fbea4c7..f9bc2ab66e 100644
return this.ba; return this.ba;
} }
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 7d2808aa29..c2c4224385 100644 index 4c774e31dc..ebf0298631 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -137,6 +137,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -137,6 +137,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -80,7 +80,7 @@ index 7d2808aa29..c2c4224385 100644
private static double a(ChunkCoordIntPair chunkcoordintpair, Entity entity) { private static double a(ChunkCoordIntPair chunkcoordintpair, Entity entity) {
double d0 = (double) (chunkcoordintpair.x * 16 + 8); double d0 = (double) (chunkcoordintpair.x * 16 + 8);
double d1 = (double) (chunkcoordintpair.z * 16 + 8); double d1 = (double) (chunkcoordintpair.z * 16 + 8);
@@ -1327,8 +1328,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -1340,8 +1341,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
} }
@@ -163,7 +163,7 @@ index 925efd4a15..70580355c6 100644
@Nullable @Nullable
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index c039d4f884..1331baf584 100644 index ba4f7999f9..38768a5002 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java --- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -70,6 +70,7 @@ public class WorldServer extends World { @@ -70,6 +70,7 @@ public class WorldServer extends World {
@@ -174,7 +174,7 @@ index c039d4f884..1331baf584 100644
// CraftBukkit start // CraftBukkit start
private int tickPosition; private int tickPosition;
@@ -937,6 +938,7 @@ public class WorldServer extends World { @@ -966,6 +967,7 @@ public class WorldServer extends World {
} }
public Object2IntMap<EnumCreatureType> l() { public Object2IntMap<EnumCreatureType> l() {
@@ -182,7 +182,7 @@ index c039d4f884..1331baf584 100644
Object2IntMap<EnumCreatureType> object2intmap = new Object2IntOpenHashMap(); Object2IntMap<EnumCreatureType> object2intmap = new Object2IntOpenHashMap();
ObjectIterator objectiterator = this.entitiesById.values().iterator(); ObjectIterator objectiterator = this.entitiesById.values().iterator();
@@ -961,14 +963,48 @@ public class WorldServer extends World { @@ -990,14 +992,48 @@ public class WorldServer extends World {
entity.spawnReason == CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) { entity.spawnReason == CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) {
continue; continue;
} }