mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-03 23:07:40 +01:00
Don't make per-player scale mob counts with the spawn range
https://github.com/PaperMC/Paper/pull/3971#issuecomment-663316000
This commit is contained in:
parent
254605cdae
commit
14fa92720f
@ -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;
|
||||
+ }
|
||||
|
Loading…
Reference in New Issue
Block a user