Add dropped hunk from mid-tick tasks (#7034)
This commit is contained in:
parent
69a15173ba
commit
a271feefae
5 changed files with 25 additions and 24 deletions
|
@ -26,8 +26,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -0,0 +0,0 @@ public class ServerChunkCache extends ChunkSource {
|
||||
});
|
||||
gameprofilerfiller.pop();
|
||||
|
||||
// Paper - no, iterating just ONCE is expensive enough! Don't do it TWICE! Code moved up
|
||||
gameprofilerfiller.pop();
|
||||
+ // Paper start - controlled flush for entity tracker packets
|
||||
+ List<net.minecraft.network.Connection> disabledFlushes = new java.util.ArrayList<>(this.level.players.size());
|
||||
|
|
|
@ -107,6 +107,26 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
return true;
|
||||
} else {
|
||||
if (this.haveTime()) {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -0,0 +0,0 @@ public class ServerChunkCache extends ChunkSource {
|
||||
iterator1 = shuffled.iterator();
|
||||
}
|
||||
|
||||
+ int chunksTicked = 0; // Paper
|
||||
try {
|
||||
while (iterator1.hasNext()) {
|
||||
LevelChunk chunk1 = iterator1.next();
|
||||
@@ -0,0 +0,0 @@ public class ServerChunkCache extends ChunkSource {
|
||||
|
||||
if (this.level.shouldTickBlocksAt(chunkcoordintpair.toLong())) {
|
||||
this.level.tickChunk(chunk1, k);
|
||||
+ if ((chunksTicked++ & 1) == 0) net.minecraft.server.MinecraftServer.getServer().executeMidTickTasks(); // Paper
|
||||
}
|
||||
}
|
||||
// Paper start - optimise chunk tick iteration
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
|
|
|
@ -6528,7 +6528,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
+ // Paper start
|
||||
+ public final com.destroystokyo.paper.util.maplist.EntityList entities = new com.destroystokyo.paper.util.maplist.EntityList();
|
||||
+ public ChunkHolder playerChunk;
|
||||
+ public @Nullable ChunkHolder playerChunk;
|
||||
+
|
||||
+ static final int NEIGHBOUR_CACHE_RADIUS = 3;
|
||||
+ public static int getNeighbourCacheRadius() {
|
||||
|
|
|
@ -102,5 +102,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
- gameprofilerfiller.pop();
|
||||
+ // Paper - no, iterating just ONCE is expensive enough! Don't do it TWICE! Code moved up
|
||||
gameprofilerfiller.pop();
|
||||
// Paper start - controlled flush for entity tracker packets
|
||||
List<net.minecraft.network.Connection> disabledFlushes = new java.util.ArrayList<>(this.level.players.size());
|
||||
this.chunkMap.tick();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue