From 425c978b93b9e0da96bd17112ee7aee0cad1e025 Mon Sep 17 00:00:00 2001 From: Alexandra-Myers Date: Sat, 7 Mar 2026 16:30:17 -0500 Subject: [PATCH] Use accurate name for the magic number --- Minecraft.World/MobSpawner.cpp | 2 +- Minecraft.World/MobSpawner.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Minecraft.World/MobSpawner.cpp b/Minecraft.World/MobSpawner.cpp index a6659b947..44feb913f 100644 --- a/Minecraft.World/MobSpawner.cpp +++ b/Minecraft.World/MobSpawner.cpp @@ -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 diff --git a/Minecraft.World/MobSpawner.h b/Minecraft.World/MobSpawner.h index 153002537..8f1e32179 100644 --- a/Minecraft.World/MobSpawner.h +++ b/Minecraft.World/MobSpawner.h @@ -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: