Yatopia/patches/server/0061-Do-not-update-distance-map-when-animal-and-mob-spawn.patch

24 lines
1.4 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Beech Horn <beechhorn@gmail.com>
Date: Mon, 7 Dec 2020 21:16:51 +0200
Subject: [PATCH] Do not update distance map when animal and mob spawning is
disabled in the particular world
Original author: Beech Horn <beechhorn@gmail.com>
Licensed under Bukkit and CraftBukkit's original license, GPLv3
The following patch should be treated as it is licensed in GPLv3
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
2021-01-10 13:31:15 +01:00
index ecf5a01e47e2a61d88badce44adad30d6e755cfb..7ee7be7c69c80f72dadbb5296c49a6f07196f670 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
2021-01-10 13:31:15 +01:00
@@ -974,7 +974,7 @@ public class ChunkProviderServer extends IChunkProvider {
int l = this.chunkMapDistance.b();
// Paper start - per player mob spawning
SpawnerCreature.d spawnercreature_d; // moved down
- if (this.playerChunkMap.playerMobDistanceMap != null) {
+ if ((this.allowAnimals || this.allowMonsters) && this.playerChunkMap.playerMobDistanceMap != null) { // Yatopia
// update distance map
this.world.timings.playerMobDistanceMapUpdate.startTiming();
this.playerChunkMap.playerMobDistanceMap.update(this.world.players, this.playerChunkMap.viewDistance);