13
0
geforkt von Mirrors/Paper

Don't make per-player scale mob counts with the spawn range

https://github.com/PaperMC/Paper/pull/3971#issuecomment-663316000
Dieser Commit ist enthalten in:
Shane Freeder 2020-07-24 21:34:41 +01:00
Ursprung 254605cdae
Commit 14fa92720f

Datei anzeigen

@ -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;
+ }