mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-02 04:49:14 +01:00
Do not tick Chunk TickS for every chunk
This commit is contained in:
parent
55888af12f
commit
d963592869
5 changed files with 14 additions and 9 deletions
|
@ -175,18 +175,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
this.world.getMethodProfiler().exit();
|
||||
this.clearCache();
|
||||
@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
entityPlayer.playerNaturallySpawnedEvent.callEvent();
|
||||
};
|
||||
// Paper end
|
||||
this.world.timings.chunkTicks.startTiming(); // Paper
|
||||
- this.playerChunkMap.forEachVisibleChunk((playerchunk) -> { // Paper - safe iterator incase chunk loads, also no wrapping
|
||||
+ final int[] chunksTicked = {0}; this.playerChunkMap.forEachVisibleChunk((playerchunk) -> { // Paper - safe iterator incase chunk loads, also no wrapping
|
||||
Optional<Chunk> optional = ((Either) playerchunk.a().getNow(PlayerChunk.UNLOADED_CHUNK)).left();
|
||||
|
||||
if (optional.isPresent()) {
|
||||
@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
this.world.timings.chunkTicks.startTiming(); // Spigot // Paper
|
||||
//this.world.timings.chunkTicks.startTiming(); // Spigot // Paper
|
||||
this.world.a(chunk, k);
|
||||
this.world.timings.chunkTicks.stopTiming(); // Spigot // Paper
|
||||
//this.world.timings.chunkTicks.stopTiming(); // Spigot // Paper
|
||||
+ if (chunksTicked[0]++ % 10 == 0) this.world.getMinecraftServer().midTickLoadChunks(); // Paper
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,9 +74,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
|
||||
@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
entityPlayer.playerNaturallySpawnedEvent.callEvent();
|
||||
};
|
||||
// Paper end
|
||||
this.world.timings.chunkTicks.startTiming(); // Paper
|
||||
- this.playerChunkMap.f().forEach((playerchunk) -> { // Paper - no... just no...
|
||||
+ this.playerChunkMap.forEachVisibleChunk((playerchunk) -> { // Paper - safe iterator incase chunk loads, also no wrapping
|
||||
Optional<Chunk> optional = ((Either) playerchunk.a().getNow(PlayerChunk.UNLOADED_CHUNK)).left();
|
||||
|
|
|
@ -132,9 +132,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
- };
|
||||
- // Paper end
|
||||
+ // Paper - moved up
|
||||
this.world.timings.chunkTicks.startTiming(); // Paper
|
||||
final int[] chunksTicked = {0}; this.playerChunkMap.forEachVisibleChunk((playerchunk) -> { // Paper - safe iterator incase chunk loads, also no wrapping
|
||||
Optional<Chunk> optional = ((Either) playerchunk.a().getNow(PlayerChunk.UNLOADED_CHUNK)).left();
|
||||
|
||||
@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
Chunk chunk = (Chunk) optional1.get();
|
||||
ChunkCoordIntPair chunkcoordintpair = playerchunk.i();
|
||||
|
|
|
@ -25,9 +25,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ entityPlayer.playerNaturallySpawnedEvent.callEvent();
|
||||
+ };
|
||||
+ // Paper end
|
||||
this.world.timings.chunkTicks.startTiming(); // Paper
|
||||
this.playerChunkMap.f().forEach((playerchunk) -> { // Paper - no... just no...
|
||||
Optional<Chunk> optional = ((Either) playerchunk.a().getNow(PlayerChunk.UNLOADED_CHUNK)).left();
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
||||
|
|
|
@ -1113,7 +1113,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
this.p = spawnercreature_d;
|
||||
this.world.getMethodProfiler().exit();
|
||||
@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
//List<PlayerChunk> list = Lists.newArrayList(this.playerChunkMap.f()); // Paper
|
||||
//Collections.shuffle(list); // Paper
|
||||
+ this.world.timings.chunkTicks.startTiming(); // Paper
|
||||
this.playerChunkMap.f().forEach((playerchunk) -> { // Paper - no... just no...
|
||||
Optional<Chunk> optional = ((Either) playerchunk.a().getNow(PlayerChunk.UNLOADED_CHUNK)).left();
|
||||
|
||||
if (optional.isPresent()) {
|
||||
this.world.getMethodProfiler().enter("broadcast");
|
||||
|
@ -1128,14 +1132,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
}
|
||||
|
||||
- this.world.timings.doTickTiles.startTiming(); // Spigot
|
||||
+ this.world.timings.chunkTicks.startTiming(); // Spigot // Paper
|
||||
+ //this.world.timings.chunkTicks.startTiming(); // Spigot // Paper
|
||||
this.world.a(chunk, k);
|
||||
- this.world.timings.doTickTiles.stopTiming(); // Spigot
|
||||
+ this.world.timings.chunkTicks.stopTiming(); // Spigot // Paper
|
||||
+ //this.world.timings.chunkTicks.stopTiming(); // Spigot // Paper
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
+ this.world.timings.chunkTicks.stopTiming(); // Paper
|
||||
this.world.getMethodProfiler().enter("customSpawners");
|
||||
if (flag1) {
|
||||
+ try (co.aikar.timings.Timing ignored = this.world.timings.miscMobSpawning.startTiming()) { // Paper - timings
|
||||
|
|
Loading…
Add table
Reference in a new issue