From 14fa92720f31ff42c523a5d33eb07fefd5582b09 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Fri, 24 Jul 2020 21:34:41 +0100 Subject: [PATCH] Don't make per-player scale mob counts with the spawn range https://github.com/PaperMC/Paper/pull/3971#issuecomment-663316000 --- .../implement-optional-per-player-mob-spawns.patch | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Spigot-Server-Patches/implement-optional-per-player-mob-spawns.patch b/Spigot-Server-Patches/implement-optional-per-player-mob-spawns.patch index 50f304d0bd..1f06174400 100644 --- a/Spigot-Server-Patches/implement-optional-per-player-mob-spawns.patch +++ b/Spigot-Server-Patches/implement-optional-per-player-mob-spawns.patch @@ -696,10 +696,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (worldserver.paperConfig.perPlayerMobSpawns) { + int minDiff = Integer.MAX_VALUE; + for (EntityPlayer entityplayer : worldserver.getChunkProvider().playerChunkMap.playerMobDistanceMap.getPlayersInRange(chunk.getPos())) { -+ int chunkRange = entityplayer.playerNaturallySpawnedEvent.getSpawnRadius(); -+ double rangeScale = (double)((chunkRange * 2 + 1) * (chunkRange * 2 + 1)) / SpawnerCreature.b; -+ int scaledLimit = (int)Math.round(rangeScale * limit); -+ minDiff = Math.min(scaledLimit - worldserver.getChunkProvider().playerChunkMap.getMobCountNear(entityplayer, enumcreaturetype), minDiff); ++ minDiff = Math.min(limit - worldserver.getChunkProvider().playerChunkMap.getMobCountNear(entityplayer, enumcreaturetype), minDiff); + } + difference = (minDiff == Integer.MAX_VALUE) ? 0 : minDiff; + }