Do not tick Chunk TickS for every chunk
This commit is contained in:
@@ -175,18 +175,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
this.world.getMethodProfiler().exit();
|
this.world.getMethodProfiler().exit();
|
||||||
this.clearCache();
|
this.clearCache();
|
||||||
@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider {
|
@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||||
entityPlayer.playerNaturallySpawnedEvent.callEvent();
|
|
||||||
};
|
};
|
||||||
// Paper end
|
// Paper end
|
||||||
|
this.world.timings.chunkTicks.startTiming(); // Paper
|
||||||
- this.playerChunkMap.forEachVisibleChunk((playerchunk) -> { // Paper - safe iterator incase chunk loads, also no wrapping
|
- 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
|
+ 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();
|
Optional<Chunk> optional = ((Either) playerchunk.a().getNow(PlayerChunk.UNLOADED_CHUNK)).left();
|
||||||
|
|
||||||
if (optional.isPresent()) {
|
if (optional.isPresent()) {
|
||||||
@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider {
|
@@ -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.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
|
+ 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
|
--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
|
||||||
+++ b/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 {
|
@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||||
entityPlayer.playerNaturallySpawnedEvent.callEvent();
|
|
||||||
};
|
};
|
||||||
// Paper end
|
// Paper end
|
||||||
|
this.world.timings.chunkTicks.startTiming(); // Paper
|
||||||
- this.playerChunkMap.f().forEach((playerchunk) -> { // Paper - no... just no...
|
- this.playerChunkMap.f().forEach((playerchunk) -> { // Paper - no... just no...
|
||||||
+ this.playerChunkMap.forEachVisibleChunk((playerchunk) -> { // Paper - safe iterator incase chunk loads, also no wrapping
|
+ this.playerChunkMap.forEachVisibleChunk((playerchunk) -> { // Paper - safe iterator incase chunk loads, also no wrapping
|
||||||
Optional<Chunk> optional = ((Either) playerchunk.a().getNow(PlayerChunk.UNLOADED_CHUNK)).left();
|
Optional<Chunk> optional = ((Either) playerchunk.a().getNow(PlayerChunk.UNLOADED_CHUNK)).left();
|
||||||
|
|||||||
@@ -132,9 +132,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
- };
|
- };
|
||||||
- // Paper end
|
- // Paper end
|
||||||
+ // Paper - moved up
|
+ // 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
|
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();
|
Optional<Chunk> optional = ((Either) playerchunk.a().getNow(PlayerChunk.UNLOADED_CHUNK)).left();
|
||||||
|
|
||||||
@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider {
|
@@ -0,0 +0,0 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||||
Chunk chunk = (Chunk) optional1.get();
|
Chunk chunk = (Chunk) optional1.get();
|
||||||
ChunkCoordIntPair chunkcoordintpair = playerchunk.i();
|
ChunkCoordIntPair chunkcoordintpair = playerchunk.i();
|
||||||
|
|||||||
@@ -25,9 +25,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ entityPlayer.playerNaturallySpawnedEvent.callEvent();
|
+ entityPlayer.playerNaturallySpawnedEvent.callEvent();
|
||||||
+ };
|
+ };
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
|
this.world.timings.chunkTicks.startTiming(); // Paper
|
||||||
this.playerChunkMap.f().forEach((playerchunk) -> { // Paper - no... just no...
|
this.playerChunkMap.f().forEach((playerchunk) -> { // Paper - no... just no...
|
||||||
Optional<Chunk> optional = ((Either) playerchunk.a().getNow(PlayerChunk.UNLOADED_CHUNK)).left();
|
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
|
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
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
||||||
|
|||||||
@@ -1113,7 +1113,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
|
|
||||||
this.p = spawnercreature_d;
|
this.p = spawnercreature_d;
|
||||||
this.world.getMethodProfiler().exit();
|
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()) {
|
if (optional.isPresent()) {
|
||||||
this.world.getMethodProfiler().enter("broadcast");
|
this.world.getMethodProfiler().enter("broadcast");
|
||||||
@@ -1128,14 +1132,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
}
|
}
|
||||||
|
|
||||||
- this.world.timings.doTickTiles.startTiming(); // Spigot
|
- 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.a(chunk, k);
|
||||||
- this.world.timings.doTickTiles.stopTiming(); // Spigot
|
- 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");
|
this.world.getMethodProfiler().enter("customSpawners");
|
||||||
if (flag1) {
|
if (flag1) {
|
||||||
+ try (co.aikar.timings.Timing ignored = this.world.timings.miscMobSpawning.startTiming()) { // Paper - timings
|
+ try (co.aikar.timings.Timing ignored = this.world.timings.miscMobSpawning.startTiming()) { // Paper - timings
|
||||||
|
|||||||
Reference in New Issue
Block a user