This commit is contained in:
Nassim Jahnke 2023-12-06 21:14:54 +01:00
parent ff2946e04b
commit 9bc67abccf
3 changed files with 10 additions and 10 deletions

View file

@ -1031,7 +1031,7 @@ index 770f6a08c613093577172385549df8040ded627b..c1bb511cc25ca97282ee02d2b207e294
}
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 7cacfceed5ef9276a19123a8a9079579423d03ac..6c33eefffad236b8c43bad891b3a3ec09e2d083a 100644
index 7cacfceed5ef9276a19123a8a9079579423d03ac..016f387f1f69572634adf3455b295ef5005b84e9 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -413,13 +413,15 @@ public class ServerChunkCache extends ChunkSource {
@ -1094,7 +1094,7 @@ index 7cacfceed5ef9276a19123a8a9079579423d03ac..6c33eefffad236b8c43bad891b3a3ec0
this.lastSpawnState = spawnercreature_d;
gameprofilerfiller.popPush("spawnAndTick");
@@ -719,22 +726,24 @@ public class ServerChunkCache extends ChunkSource {
@@ -719,22 +726,25 @@ public class ServerChunkCache extends ChunkSource {
}
if (this.level.shouldTickBlocksAt(chunkcoordintpair.toLong())) {
@ -1104,6 +1104,7 @@ index 7cacfceed5ef9276a19123a8a9079579423d03ac..6c33eefffad236b8c43bad891b3a3ec0
}
}
}
+ this.level.timings.chunkTicks.stopTiming(); // Paper
gameprofilerfiller.popPush("customSpawners");
if (flag) {

View file

@ -19101,7 +19101,7 @@ index f3c9a3dbb6f0e6f825b7477c89ed72ed52845419..942042863f0105769c15b865d4d98a09
+ */ // Paper - rewrite chunk system
}
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 6c33eefffad236b8c43bad891b3a3ec09e2d083a..b4d36ff6b6ba72693c269929b84c5481949f13fd 100644
index 016f387f1f69572634adf3455b295ef5005b84e9..15d928a33306937661e5fed88e2ef7afae8141d2 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -139,108 +139,7 @@ public class ServerChunkCache extends ChunkSource {
@ -19498,7 +19498,7 @@ index 6c33eefffad236b8c43bad891b3a3ec09e2d083a..b4d36ff6b6ba72693c269929b84c5481
this.tickChunks();
this.level.timings.chunks.stopTiming(); // Paper - timings
this.chunkMap.tick();
@@ -754,7 +601,12 @@ public class ServerChunkCache extends ChunkSource {
@@ -755,7 +602,12 @@ public class ServerChunkCache extends ChunkSource {
ChunkHolder playerchunk = this.getVisibleChunkIfPresent(pos);
if (playerchunk != null) {
@ -19512,7 +19512,7 @@ index 6c33eefffad236b8c43bad891b3a3ec09e2d083a..b4d36ff6b6ba72693c269929b84c5481
}
}
@@ -920,17 +772,10 @@ public class ServerChunkCache extends ChunkSource {
@@ -921,17 +773,10 @@ public class ServerChunkCache extends ChunkSource {
@Override
// CraftBukkit start - process pending Chunk loadCallback() and unloadCallback() after each run task
public boolean pollTask() {

View file

@ -187,7 +187,7 @@ index 68550d4497a5f10bf653482f79be77373df53f27..55f96545d6db95e3e657502a7910d96f
public String getDebugStatus() {
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index bb222f61b67ea6b8e2b900dbfdcdbe58b1caabca..5b4e62e1d31f9c34fb186a9de0e9bc9c9fb18552 100644
index 5689a463ae25778cc0f0b1970e3894d863253dfc..5b4e62e1d31f9c34fb186a9de0e9bc9c9fb18552 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -516,18 +516,43 @@ public class ServerChunkCache extends ChunkSource {
@ -241,7 +241,7 @@ index bb222f61b67ea6b8e2b900dbfdcdbe58b1caabca..5b4e62e1d31f9c34fb186a9de0e9bc9c
if (this.level.getServer().tickRateManager().runsNormally()) {
gameprofilerfiller.popPush("naturalSpawnCount");
@@ -562,38 +587,108 @@ public class ServerChunkCache extends ChunkSource {
@@ -562,38 +587,107 @@ public class ServerChunkCache extends ChunkSource {
gameprofilerfiller.popPush("spawnAndTick");
boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit
@ -362,11 +362,10 @@ index bb222f61b67ea6b8e2b900dbfdcdbe58b1caabca..5b4e62e1d31f9c34fb186a9de0e9bc9c
+ }
+ }
+ // Paper end - optimise chunk tick iteration
+ this.level.timings.chunkTicks.stopTiming(); // Paper
this.level.timings.chunkTicks.stopTiming(); // Paper
gameprofilerfiller.popPush("customSpawners");
if (flag) {
@@ -604,11 +699,23 @@ public class ServerChunkCache extends ChunkSource {
@@ -605,11 +699,23 @@ public class ServerChunkCache extends ChunkSource {
}
gameprofilerfiller.popPush("broadcast");