mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Updated Upstream (Paper)
Upstream has released updates that appears to apply and compile correctly Paper Changes: 767ac20c Merge pull request #2174 from kickash32/Only-count-Natural-Spawned-mobs fa726c3f Create 0402-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch 97488cca Merge pull request #2296 from Spottedleaf/fix-loadchunk-again 36c48316 Fix loadChunk(x, z, false)
This commit is contained in:
2
Paper
2
Paper
Submodule Paper updated: ff085b8e8e...767ac20c2c
@@ -1 +1 @@
|
||||
1.14.3--25c12696d468f7db5758f8fcfe3af27af0f4da0a
|
||||
1.14.3--c6a5c51dde48b9f77bbbf0ffcd79eb7ed3032ec8
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 6126176f12b4e60b90fbf20a0e531a00f539dbf0 Mon Sep 17 00:00:00 2001
|
||||
From bac1c8ce3da3e46925a266eca6be5b9c9c7e8b66 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Thu, 6 Jun 2019 23:23:52 -0500
|
||||
Subject: [PATCH] Block and Fluid Tick Events
|
||||
@@ -10,7 +10,7 @@ Subject: [PATCH] Block and Fluid Tick Events
|
||||
3 files changed, 29 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index c646393eb..9fbfdb803 100644
|
||||
index 959fc99bb8..95d5cd1c66 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -447,13 +447,13 @@ public class WorldServer extends World {
|
||||
@@ -46,7 +46,7 @@ index c646393eb..9fbfdb803 100644
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 9dfba251e..775d40ab1 100644
|
||||
index 9dfba251ea..775d40ab1b 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -106,4 +106,11 @@ public class PurpurWorldConfig {
|
||||
@@ -62,10 +62,10 @@ index 9dfba251e..775d40ab1 100644
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index ece1a68c1..85b5c2bff 100644
|
||||
index f01e8a87e8..c5321c5076 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -2296,6 +2296,24 @@ public class CraftWorld implements World {
|
||||
@@ -2336,6 +2336,24 @@ public class CraftWorld implements World {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 440cb45fa9f3b61badc7545a04a0daff24e474f4 Mon Sep 17 00:00:00 2001
|
||||
From d7a653379c6a6446a42907cd03e9d1348844f893 Mon Sep 17 00:00:00 2001
|
||||
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
||||
Date: Mon, 8 Jul 2019 03:24:59 -0700
|
||||
Subject: [PATCH] Asynchronous chunk loading api
|
||||
@@ -7,10 +7,10 @@ Subject: [PATCH] Asynchronous chunk loading api
|
||||
.../minecraft/server/ChunkProviderServer.java | 134 ++++++++++++++++++
|
||||
.../net/minecraft/server/ChunkStatus.java | 1 +
|
||||
.../java/net/minecraft/server/MCUtil.java | 5 +
|
||||
.../java/net/minecraft/server/RegionFile.java | 1 +
|
||||
.../java/net/minecraft/server/RegionFile.java | 2 +-
|
||||
.../java/net/minecraft/server/TicketType.java | 1 +
|
||||
.../org/bukkit/craftbukkit/CraftWorld.java | 19 +--
|
||||
6 files changed, 152 insertions(+), 9 deletions(-)
|
||||
6 files changed, 152 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
index db9113994e..b46285ecdc 100644
|
||||
@@ -184,13 +184,14 @@ index 23d1935dd5..14f8b61042 100644
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
|
||||
index d610253b95..18f218e971 100644
|
||||
index 66c8b0307f..3e80f6c53e 100644
|
||||
--- a/src/main/java/net/minecraft/server/RegionFile.java
|
||||
+++ b/src/main/java/net/minecraft/server/RegionFile.java
|
||||
@@ -327,6 +327,7 @@ public class RegionFile implements AutoCloseable {
|
||||
@@ -310,7 +310,7 @@ public class RegionFile implements AutoCloseable {
|
||||
return this.c[this.f(chunkcoordintpair)];
|
||||
}
|
||||
|
||||
- public final boolean chunkExists(ChunkCoordIntPair chunkPos) { return this.d(chunkPos); } // Paper - OBFHELPER
|
||||
+ public boolean chunkExists(ChunkCoordIntPair chunkPos) { return this.d(chunkPos); } // Paper - OBFHELPER
|
||||
public boolean d(ChunkCoordIntPair chunkcoordintpair) {
|
||||
return this.getOffset(chunkcoordintpair) != 0;
|
||||
@@ -208,10 +209,10 @@ index 5acb0732c3..0ed2d2fbf9 100644
|
||||
public static <T> TicketType<T> a(String s, Comparator<T> comparator) {
|
||||
return new TicketType<>(s, comparator, 0L);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 85b5c2bff0..aabb2ae26c 100644
|
||||
index c5321c5076..7691f23316 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -2283,16 +2283,17 @@ public class CraftWorld implements World {
|
||||
@@ -2323,16 +2323,17 @@ public class CraftWorld implements World {
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Chunk> getChunkAtAsync(int x, int z, boolean gen) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From c2a26437cd05c2c5023a3e609ccd6dfd25757f69 Mon Sep 17 00:00:00 2001
|
||||
From 6a1a8b6aafe4641484ae13615a21920c863586ae Mon Sep 17 00:00:00 2001
|
||||
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
||||
Date: Tue, 9 Jul 2019 03:38:23 -0700
|
||||
Subject: [PATCH] Asynchronous chunk IO
|
||||
@@ -11,12 +11,12 @@ Subject: [PATCH] Asynchronous chunk IO
|
||||
.../minecraft/server/ChunkProviderServer.java | 5 +
|
||||
.../net/minecraft/server/MinecraftServer.java | 1 +
|
||||
.../net/minecraft/server/PlayerChunkMap.java | 152 +++-
|
||||
.../java/net/minecraft/server/RegionFile.java | 17 +-
|
||||
.../java/net/minecraft/server/RegionFile.java | 6 +-
|
||||
.../net/minecraft/server/RegionFileCache.java | 6 +-
|
||||
.../minecraft/server/RegionFileSection.java | 57 +-
|
||||
.../net/minecraft/server/VillagePlace.java | 64 +-
|
||||
.../net/minecraft/server/WorldServer.java | 72 ++
|
||||
12 files changed, 1498 insertions(+), 52 deletions(-)
|
||||
12 files changed, 1501 insertions(+), 38 deletions(-)
|
||||
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/PrioritizedTaskQueue.java
|
||||
@@ -1261,7 +1261,7 @@ index 0324a90ca5..430cd70cf5 100644
|
||||
|
||||
public String getServerIp() {
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
index f5b35b95b2..ae18431c38 100644
|
||||
index a439277813..6ca98b7ad5 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
@@ -57,7 +57,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
||||
@@ -1414,7 +1414,7 @@ index f5b35b95b2..ae18431c38 100644
|
||||
|
||||
if (chunkstatus.getType() != ChunkStatus.Type.LEVELCHUNK) {
|
||||
// Paper start - Optimize save by using status cache
|
||||
- ChunkStatus statusOnDisk = this.getRegionFile(ichunkaccess.getPos(), false).getStatus(ichunkaccess.getPos().x, ichunkaccess.getPos().z, this);
|
||||
- ChunkStatus statusOnDisk = this.getChunkStatusOnDisk(chunkcoordintpair);
|
||||
+ ChunkStatus statusOnDisk = this.getChunkStatus(chunkcoordintpair, true); // Paper - Async chunk io
|
||||
if (statusOnDisk != null && statusOnDisk.getType() == ChunkStatus.Type.LEVELCHUNK) {
|
||||
// Paper end
|
||||
@@ -1503,14 +1503,14 @@ index f5b35b95b2..ae18431c38 100644
|
||||
return null;
|
||||
}
|
||||
|
||||
- this.getRegionFile(chunkcoordintpair, false).setStatus(chunkcoordintpair.x, chunkcoordintpair.z, ChunkRegionLoader.getStatus(nbttagcompound));
|
||||
- this.updateChunkStatusOnDisk(chunkcoordintpair, nbttagcompound);
|
||||
+ synchronized (this) { // Async chunk io - Synchronize so we do not potentially get and use a closed region file
|
||||
+ this.getRegionFile(chunkcoordintpair, false).setStatus(chunkcoordintpair.x, chunkcoordintpair.z, ChunkRegionLoader.getStatus(nbttagcompound));
|
||||
+ }
|
||||
|
||||
return nbttagcompound;
|
||||
// Paper end
|
||||
@@ -1165,6 +1274,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
||||
@@ -1197,6 +1306,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
||||
|
||||
}
|
||||
|
||||
@@ -1519,32 +1519,21 @@ index f5b35b95b2..ae18431c38 100644
|
||||
return this.n;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
|
||||
index 18f218e971..2f10152404 100644
|
||||
index 3e80f6c53e..2f10152404 100644
|
||||
--- a/src/main/java/net/minecraft/server/RegionFile.java
|
||||
+++ b/src/main/java/net/minecraft/server/RegionFile.java
|
||||
@@ -55,20 +55,7 @@ public class RegionFile implements AutoCloseable {
|
||||
@@ -53,6 +53,10 @@ public class RegionFile implements AutoCloseable {
|
||||
final int location = this.getChunkLocation(new ChunkCoordIntPair(x, z));
|
||||
return this.statuses[location];
|
||||
}
|
||||
|
||||
public ChunkStatus getStatus(int x, int z, PlayerChunkMap playerChunkMap) throws IOException {
|
||||
- if (this.closed) {
|
||||
- // We've used an invalid region file.
|
||||
- throw new java.io.EOFException("RegionFile is closed");
|
||||
- }
|
||||
- ChunkCoordIntPair chunkPos = new ChunkCoordIntPair(x, z);
|
||||
- int location = this.getChunkLocation(chunkPos);
|
||||
- ChunkStatus cached = this.statuses[location];
|
||||
- if (cached != null) {
|
||||
- return cached;
|
||||
- }
|
||||
-
|
||||
- playerChunkMap.readChunkData(chunkPos); // This will set our status (yes it's disgusting)
|
||||
-
|
||||
- return this.statuses[location];
|
||||
+
|
||||
+ public ChunkStatus getStatus(int x, int z, PlayerChunkMap playerChunkMap) throws IOException {
|
||||
+ return playerChunkMap.getChunkStatus(new ChunkCoordIntPair(x, z), true);
|
||||
}
|
||||
+ }
|
||||
// Paper end
|
||||
|
||||
@@ -354,7 +341,7 @@ public class RegionFile implements AutoCloseable {
|
||||
public RegionFile(File file) throws IOException {
|
||||
@@ -337,7 +341,7 @@ public class RegionFile implements AutoCloseable {
|
||||
this.writeInt(i); // Paper - Avoid 3 io write calls
|
||||
}
|
||||
|
||||
@@ -1812,7 +1801,7 @@ index 7bc473e1ef..9f4b1b4c49 100644
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index b5c902e1de..7f7b2a539a 100644
|
||||
index 47005dcfdc..f0380c5df4 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -75,6 +75,78 @@ public class WorldServer extends World {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From a84ef584ec3dac4bc6b2b29db3a2492603708f6d Mon Sep 17 00:00:00 2001
|
||||
From 854429ab6cd52dfd88f48b40206055b8790085f0 Mon Sep 17 00:00:00 2001
|
||||
From: kickash32 <kickash32@gmail.com>
|
||||
Date: Tue, 11 Jun 2019 22:22:16 -0400
|
||||
Subject: [PATCH] Implement optional per player mob spawns
|
||||
@@ -13,11 +13,11 @@ Subject: [PATCH] Implement optional per player mob spawns
|
||||
6 files changed, 78 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 929f5c3031..4fcfcc34f8 100644
|
||||
index ff520d9e86..5ed02f6485 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -509,6 +509,11 @@ public class PaperWorldConfig {
|
||||
maxAutoSaveChunksPerTick = getInt("max-auto-save-chunks-per-tick", 24);
|
||||
@@ -519,6 +519,11 @@ public class PaperWorldConfig {
|
||||
}
|
||||
}
|
||||
|
||||
+ public boolean perPlayerMobSpawns = false;
|
||||
@@ -57,7 +57,7 @@ index f6a6421140..770ee018fe 100644
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
index ae18431c38..0bcf93e612 100644
|
||||
index 6ca98b7ad5..56e60e0ce1 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
@@ -105,6 +105,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
||||
@@ -68,7 +68,7 @@ index ae18431c38..0bcf93e612 100644
|
||||
private static double a(ChunkCoordIntPair chunkcoordintpair, Entity entity) {
|
||||
double d0 = (double) (chunkcoordintpair.x * 16 + 8);
|
||||
double d1 = (double) (chunkcoordintpair.z * 16 + 8);
|
||||
@@ -1099,6 +1100,15 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
||||
@@ -1131,6 +1132,15 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
||||
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ index af397dd1f7..5e001733a9 100644
|
||||
|
||||
@Nullable
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 7f7b2a539a..54b13b046d 100644
|
||||
index f0380c5df4..0c4fd5ca4d 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -17,6 +17,9 @@ import it.unimi.dsi.fastutil.objects.Object2IntMap;
|
||||
@@ -196,9 +196,9 @@ index 7f7b2a539a..54b13b046d 100644
|
||||
Object2IntMap<EnumCreatureType> object2intmap = new Object2IntOpenHashMap();
|
||||
ObjectIterator objectiterator = this.entitiesById.values().iterator();
|
||||
|
||||
@@ -950,13 +955,47 @@ public class WorldServer extends World {
|
||||
|
||||
if (enumcreaturetype != EnumCreatureType.MISC && this.getChunkProvider().b(entity)) {
|
||||
@@ -957,13 +962,47 @@ public class WorldServer extends World {
|
||||
}
|
||||
// Paper end
|
||||
object2intmap.mergeInt(enumcreaturetype, 1, Integer::sum);
|
||||
+ filteredEntities.add(entity); // Paper
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user