Fix merging spawning values

This commit is contained in:
Mariell Hoversholm 2020-12-05 14:59:05 +01:00
parent 43d8c6fcd4
commit 889192e8f8

View file

@ -710,11 +710,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return spawnercreature_d.a(entitytypes, blockposition, ichunkaccess); return spawnercreature_d.a(entitytypes, blockposition, ichunkaccess);
}, (entityinsentient, ichunkaccess) -> { }, (entityinsentient, ichunkaccess) -> {
spawnercreature_d.a(entityinsentient, ichunkaccess); spawnercreature_d.a(entityinsentient, ichunkaccess);
- });
+ }, + },
+ difference, worldserver.paperConfig.perPlayerMobSpawns ? worldserver.getChunkProvider().playerChunkMap::updatePlayerMobTypeMap : null); + difference, worldserver.paperConfig.perPlayerMobSpawns ? worldserver.getChunkProvider().playerChunkMap::updatePlayerMobTypeMap : null);
+ spawnercreature_d.getEntityCountsByType().mergeInt(enumcreaturetype, spawnCount, (keyInMap, valueInMap) -> { + spawnercreature_d.getEntityCountsByType().mergeInt(enumcreaturetype, spawnCount, Integer::sum);
+ return Integer.valueOf(spawnCount + valueInMap.intValue());
});
+ // Paper end - per player mob spawning + // Paper end - per player mob spawning
} }
} }