Paper/patches/server/0593-Skip-distance-map-update-when-spawning-disabled.patch

20 lines
1.3 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Beech Horn <beechhorn@gmail.com>
Date: Fri, 14 Feb 2020 19:39:59 +0000
Subject: [PATCH] Skip distance map update when spawning disabled.
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
2021-11-29 12:55:13 +01:00
index 364375f5da5a3daea200c97c5dca86cbb8be5fb9..f7abb67568cf1034dae3fe9e0adff9bcc36b96e7 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -966,7 +966,7 @@ public class ServerChunkCache extends ChunkSource {
2021-06-11 14:02:28 +02:00
int l = this.distanceManager.getNaturalSpawnChunkCount();
// Paper start - per player mob spawning
NaturalSpawner.SpawnState spawnercreature_d; // moved down
- if (this.chunkMap.playerMobDistanceMap != null) {
+ if ((this.spawnFriendlies || this.spawnEnemies) && this.chunkMap.playerMobDistanceMap != null) { // don't update when animals and monsters are disabled
// update distance map
this.level.timings.playerMobDistanceMapUpdate.startTiming();
this.chunkMap.playerMobDistanceMap.update(this.level.players, this.chunkMap.viewDistance);