Fix timings check with tick freezes

This commit is contained in:
Nassim Jahnke 2023-12-06 22:40:08 +01:00
parent 896e29bba7
commit 772d430cd1
2 changed files with 4 additions and 4 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..016f387f1f69572634adf3455b295ef5005b84e9 100644
index 7cacfceed5ef9276a19123a8a9079579423d03ac..5cd680d2ed47aadb5e65a775d70bc662a92e3d7a 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 {
@ -1079,7 +1079,7 @@ index 7cacfceed5ef9276a19123a8a9079579423d03ac..016f387f1f69572634adf3455b295ef5
gameprofilerfiller.push("filteringLoadedChunks");
List<ServerChunkCache.ChunkAndHolder> list = Lists.newArrayListWithCapacity(this.chunkMap.size());
Iterator iterator = this.chunkMap.getChunks().iterator();
+ this.level.timings.chunkTicks.startTiming(); // Paper
+ if (this.level.getServer().tickRateManager().runsNormally()) this.level.timings.chunkTicks.startTiming(); // Paper
while (iterator.hasNext()) {
ChunkHolder playerchunk = (ChunkHolder) iterator.next();

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 5689a463ae25778cc0f0b1970e3894d863253dfc..5b4e62e1d31f9c34fb186a9de0e9bc9c9fb18552 100644
index 5152979bf81345fc365e7b16028c7d970d2f5856..6e212f672579a3e08dc362c287be59ca5170d717 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 {
@ -196,7 +196,7 @@ index 5689a463ae25778cc0f0b1970e3894d863253dfc..5b4e62e1d31f9c34fb186a9de0e9bc9c
gameprofilerfiller.push("filteringLoadedChunks");
- List<ServerChunkCache.ChunkAndHolder> list = Lists.newArrayListWithCapacity(this.chunkMap.size());
- Iterator iterator = this.chunkMap.getChunks().iterator();
this.level.timings.chunkTicks.startTiming(); // Paper
if (this.level.getServer().tickRateManager().runsNormally()) this.level.timings.chunkTicks.startTiming(); // Paper
- while (iterator.hasNext()) {
- ChunkHolder playerchunk = (ChunkHolder) iterator.next();