aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSpottedleaf <[email protected]>2024-07-17 07:43:49 -0700
committerSpottedleaf <[email protected]>2024-07-17 07:43:49 -0700
commit967f98aa81da851740aeb429778e46159fd188df (patch)
treea0fe15261576759c6450ee2d2f814e00dc865821
parent05ed6a6ff5a82e720872a87e27c21cc3115ddd74 (diff)
downloadPaper-967f98aa81da851740aeb429778e46159fd188df.tar.gz
Paper-967f98aa81da851740aeb429778e46159fd188df.zip
Optimise chunk tick checking during chunk tick
We don't need to check for this with the chunk system, as ticking chunks are actually guaranteed to ticking. Additionally, ticking chunks may only become non-ticking during the chunk holder manager tick - which will not happen during chunk ticking.
-rw-r--r--patches/server/0989-Moonrise-optimisation-patches.patch16
1 files changed, 13 insertions, 3 deletions
diff --git a/patches/server/0989-Moonrise-optimisation-patches.patch b/patches/server/0989-Moonrise-optimisation-patches.patch
index 075e882801..6e85164f4e 100644
--- a/patches/server/0989-Moonrise-optimisation-patches.patch
+++ b/patches/server/0989-Moonrise-optimisation-patches.patch
@@ -28561,7 +28561,7 @@ index 3dc1daa3c6a04d3ff1a2353773b465fc380994a2..3575782f13a7f3c52e64dc5046803305
}
}
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
-index be9604a0f267558c95125852d86761a2f175732a..d2cb358c340bcf7532fd25eccdd33c6945d16de4 100644
+index be9604a0f267558c95125852d86761a2f175732a..337383b8aa00f5f33e770dcc0b087cda54f9b6c3 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -46,7 +46,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemp
@@ -28887,9 +28887,19 @@ index be9604a0f267558c95125852d86761a2f175732a..d2cb358c340bcf7532fd25eccdd33c69
long i = this.level.getGameTime();
long j = i - this.lastInhabitedUpdate;
-@@ -470,6 +473,11 @@ public class ServerChunkCache extends ChunkSource {
+@@ -462,14 +465,19 @@ public class ServerChunkCache extends ChunkSource {
+ LevelChunk chunk1 = chunkproviderserver_a.chunk;
+ ChunkPos chunkcoordintpair = chunk1.getPos();
- if (this.level.shouldTickBlocksAt(chunkcoordintpair.toLong())) {
+- if (this.level.isNaturalSpawningAllowed(chunkcoordintpair) && this.chunkMap.anyPlayerCloseEnoughForSpawning(chunkcoordintpair)) {
++ if (true && this.chunkMap.anyPlayerCloseEnoughForSpawning(chunkcoordintpair)) { // Paper - rewrite chunk system
+ chunk1.incrementInhabitedTime(j);
+ if (flag && (this.spawnEnemies || this.spawnFriendlies) && this.level.getWorldBorder().isWithinBounds(chunkcoordintpair) && this.chunkMap.anyPlayerCloseEnoughForSpawning(chunkcoordintpair, true)) { // Spigot
+ NaturalSpawner.spawnForChunk(this.level, chunk1, spawnercreature_d, this.spawnFriendlies, this.spawnEnemies, flag1);
+ }
+
+- if (this.level.shouldTickBlocksAt(chunkcoordintpair.toLong())) {
++ if (true) { // Paper - rewrite chunk system
this.level.tickChunk(chunk1, l);
+ // Paper start - rewrite chunk system
+ if ((++chunksTicked & 7L) == 0L) {