mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 09:27:43 +01:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@09904fd Re-add legacy getChunkAtAsynchronously to ChunkProviderServer
This commit is contained in:
@@ -430,10 +430,10 @@ index 56ec684bac1c29c99bac117e38d82db2b4dc20e8..e4cec79dc5911e1f000c63fe333eea04
|
||||
//try (co.aikar.timings.Timing ignored1 = this.level.timings.chunkSaveDataSerialization.startTiming()) { // Paper // Purpur
|
||||
nbttagcompound = ChunkSerializer.write(this.level, chunk);
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
index 6b4c502cf549996411ac21251e22849be2ed7a23..25b9f739abba986264e9f59b5125c1cc9a5bf74c 100644
|
||||
index 9e796ab10152d630fe78ec247d6b0c2689ae00ab..7d8f7ecad22cdcd39270af79af8e0cd83e07bbc1 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -452,9 +452,9 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -454,9 +454,9 @@ public class ServerChunkCache extends ChunkSource {
|
||||
return ifLoaded;
|
||||
}
|
||||
// Paper end
|
||||
@@ -445,7 +445,7 @@ index 6b4c502cf549996411ac21251e22849be2ed7a23..25b9f739abba986264e9f59b5125c1cc
|
||||
long k = ChunkPos.asLong(x, z);
|
||||
|
||||
ChunkAccess ichunkaccess;
|
||||
@@ -468,7 +468,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -470,7 +470,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -454,7 +454,7 @@ index 6b4c502cf549996411ac21251e22849be2ed7a23..25b9f739abba986264e9f59b5125c1cc
|
||||
CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> completablefuture = this.getChunkFutureMainThread(x, z, leastStatus, create, true); // Paper
|
||||
ServerChunkCache.MainThreadExecutor chunkproviderserver_b = this.mainThreadProcessor;
|
||||
|
||||
@@ -567,13 +567,13 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -569,13 +569,13 @@ public class ServerChunkCache extends ChunkSource {
|
||||
this.distanceManager.addTicket(TicketType.REQUIRED_LOAD, chunkcoordintpair, l, identifier); // Paper - prevent plugin unloads from removing our ticket
|
||||
if (isUrgent) this.distanceManager.markUrgent(chunkcoordintpair); // Paper - Chunk priority
|
||||
if (this.chunkAbsent(playerchunk, l)) {
|
||||
@@ -471,7 +471,7 @@ index 6b4c502cf549996411ac21251e22849be2ed7a23..25b9f739abba986264e9f59b5125c1cc
|
||||
if (this.chunkAbsent(playerchunk, l)) {
|
||||
this.distanceManager.removeTicket(TicketType.REQUIRED_LOAD, chunkcoordintpair, l, identifier); // Paper
|
||||
throw (IllegalStateException) Util.pauseInIde(new IllegalStateException("No chunk holder after ticket has been added"));
|
||||
@@ -708,24 +708,24 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -710,24 +710,24 @@ public class ServerChunkCache extends ChunkSource {
|
||||
// CraftBukkit start - modelled on below
|
||||
public void purgeUnload() {
|
||||
if (true) return; // Paper - tickets will be removed later, this behavior isn't really well accounted for by the chunk system
|
||||
@@ -501,7 +501,7 @@ index 6b4c502cf549996411ac21251e22849be2ed7a23..25b9f739abba986264e9f59b5125c1cc
|
||||
if (tickChunks) {
|
||||
//this.level.timings.chunks.startTiming(); // Paper - timings // Purpur
|
||||
this.chunkMap.playerChunkManager.tick(); // Paper - this is mostly is to account for view distance changes
|
||||
@@ -734,10 +734,10 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -736,10 +736,10 @@ public class ServerChunkCache extends ChunkSource {
|
||||
}
|
||||
|
||||
//this.level.timings.doChunkUnload.startTiming(); // Spigot // Purpur
|
||||
@@ -514,7 +514,7 @@ index 6b4c502cf549996411ac21251e22849be2ed7a23..25b9f739abba986264e9f59b5125c1cc
|
||||
this.clearCache();
|
||||
}
|
||||
|
||||
@@ -783,14 +783,14 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -785,14 +785,14 @@ public class ServerChunkCache extends ChunkSource {
|
||||
}
|
||||
// Paper end - optimize isOutisdeRange
|
||||
LevelData worlddata = this.level.getLevelData();
|
||||
@@ -532,7 +532,7 @@ index 6b4c502cf549996411ac21251e22849be2ed7a23..25b9f739abba986264e9f59b5125c1cc
|
||||
//this.level.timings.countNaturalMobs.startTiming(); // Paper - timings // Purpur
|
||||
int l = this.distanceManager.getNaturalSpawnChunkCount();
|
||||
// Paper start - per player mob spawning
|
||||
@@ -815,13 +815,13 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -817,13 +817,13 @@ public class ServerChunkCache extends ChunkSource {
|
||||
//this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings // Purpur
|
||||
|
||||
//this.lastSpawnState = spawnercreature_d; // Pufferfish - this is managed asynchronously
|
||||
@@ -548,7 +548,7 @@ index 6b4c502cf549996411ac21251e22849be2ed7a23..25b9f739abba986264e9f59b5125c1cc
|
||||
boolean flag2 = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit
|
||||
|
||||
// Paper - only shuffle if per-player mob spawning is disabled
|
||||
@@ -872,15 +872,15 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -874,15 +874,15 @@ public class ServerChunkCache extends ChunkSource {
|
||||
}
|
||||
// Paper end - optimise chunk tick iteration
|
||||
//this.level.timings.chunkTicks.stopTiming(); // Paper // Purpur
|
||||
@@ -567,7 +567,7 @@ index 6b4c502cf549996411ac21251e22849be2ed7a23..25b9f739abba986264e9f59b5125c1cc
|
||||
//this.level.timings.broadcastChunkUpdates.startTiming(); // Paper - timing // Purpur
|
||||
if (!this.chunkMap.needsChangeBroadcasting.isEmpty()) {
|
||||
ReferenceOpenHashSet<ChunkHolder> copy = this.chunkMap.needsChangeBroadcasting.clone();
|
||||
@@ -894,7 +894,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -896,7 +896,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
}
|
||||
}
|
||||
//this.level.timings.broadcastChunkUpdates.stopTiming(); // Paper - timing // Purpur
|
||||
@@ -576,7 +576,7 @@ index 6b4c502cf549996411ac21251e22849be2ed7a23..25b9f739abba986264e9f59b5125c1cc
|
||||
// Paper end - use set of chunks requiring updates, rather than iterating every single one loaded
|
||||
// Paper start - controlled flush for entity tracker packets
|
||||
List<net.minecraft.network.Connection> disabledFlushes = new java.util.ArrayList<>(this.level.players.size());
|
||||
@@ -1100,7 +1100,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -1102,7 +1102,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
|
||||
@Override
|
||||
protected void doRunTask(Runnable task) {
|
||||
|
||||
Reference in New Issue
Block a user