Use accurate name for the magic number

This commit is contained in:
Alexandra-Myers 2026-03-07 16:30:17 -05:00
parent 949411760c
commit 425c978b93
2 changed files with 2 additions and 2 deletions

View file

@ -216,7 +216,7 @@ const int MobSpawner::tick(ServerLevel *level, bool spawnEnemies, bool spawnFrie
if (usesChunkLimit)
{
// Use Java logic for the max count instead, accounting for chunks polled and the size of a chunk.
maxInstances = mobCategory->getMaxInstancesPerChunk() * chunksToPoll.size() / CHUNK_HORIZONTAL_SCALE;
maxInstances = mobCategory->getMaxInstancesPerChunk() * chunksToPoll.size() / MAGIC_NUMBER;
}
// 4J - this is now quite different to the java version. We just have global max counts for the level whereas the original has a max per chunk that

View file

@ -13,7 +13,7 @@ class MobSpawner
{
private:
// For some reason, this constant is used in Java as the dividend for the max count of a mob category in the level, thus this is done to keep parity.
static const int CHUNK_HORIZONTAL_SCALE = 289;
static const int MAGIC_NUMBER = 289;
static const int MIN_SPAWN_DISTANCE;
protected: