mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 13:57:35 +01:00
fix exception (#5822)
This commit is contained in:
parent
d465800774
commit
0670cfd66f
@ -707,7 +707,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
|
|
||||||
- if ((spawnAnimals || !enumcreaturetype.isFriendly()) && (spawnMonsters || enumcreaturetype.isFriendly()) && (rareSpawn || !enumcreaturetype.isPersistent()) && info.a(enumcreaturetype, limit)) {
|
- if ((spawnAnimals || !enumcreaturetype.isFriendly()) && (spawnMonsters || enumcreaturetype.isFriendly()) && (rareSpawn || !enumcreaturetype.isPersistent()) && info.a(enumcreaturetype, limit)) {
|
||||||
+ // Paper start - only allow spawns upto the limit per chunk and update count afterwards
|
+ // Paper start - only allow spawns upto the limit per chunk and update count afterwards
|
||||||
+ int currEntityCount = info.getMobCategoryCounts().getInt(enumcreaturetype);
|
+ int currEntityCount = info.mobCategoryCounts.getInt(enumcreaturetype);
|
||||||
+ int k1 = limit * info.getSpawnableChunkCount() / NaturalSpawner.MAGIC_NUMBER;
|
+ int k1 = limit * info.getSpawnableChunkCount() / NaturalSpawner.MAGIC_NUMBER;
|
||||||
+ int difference = k1 - currEntityCount;
|
+ int difference = k1 - currEntityCount;
|
||||||
+
|
+
|
||||||
@ -730,7 +730,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
- NaturalSpawner.spawnCategoryForChunk(enumcreaturetype, world, chunk, spawnercreature_c, info::afterSpawn);
|
- NaturalSpawner.spawnCategoryForChunk(enumcreaturetype, world, chunk, spawnercreature_c, info::afterSpawn);
|
||||||
+ int spawnCount = NaturalSpawner.spawnCategoryForChunk(enumcreaturetype, world, chunk, spawnercreature_c, info::afterSpawn,
|
+ int spawnCount = NaturalSpawner.spawnCategoryForChunk(enumcreaturetype, world, chunk, spawnercreature_c, info::afterSpawn,
|
||||||
+ difference, world.paperConfig.perPlayerMobSpawns ? world.getChunkSource().chunkMap::updatePlayerMobTypeMap : null);
|
+ difference, world.paperConfig.perPlayerMobSpawns ? world.getChunkSource().chunkMap::updatePlayerMobTypeMap : null);
|
||||||
+ info.getMobCategoryCounts().mergeInt(enumcreaturetype, spawnCount, Integer::sum);
|
+ info.mobCategoryCounts.mergeInt(enumcreaturetype, spawnCount, Integer::sum);
|
||||||
+ // Paper end - per player mob spawning
|
+ // Paper end - per player mob spawning
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user