mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 04:32:11 -07:00
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.
This commit is contained in:
@@ -28888,8 +28888,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
long j = i - this.lastInhabitedUpdate;
|
||||
|
||||
@@ -0,0 +0,0 @@ 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) {
|
||||
|
Reference in New Issue
Block a user