SPIGOT-6927: Fix default value of spawn-limits in Worlds

This commit is contained in:
Doc 2022-02-07 18:03:56 -03:00 committed by md_5
parent febaa1c6f5
commit de95135562
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -1501,7 +1501,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
Validate.notNull(spawnCategory, "SpawnCategory cannot be null"); Validate.notNull(spawnCategory, "SpawnCategory cannot be null");
Validate.isTrue(CraftSpawnCategory.isValidForLimits(spawnCategory), "SpawnCategory." + spawnCategory + " are not supported."); Validate.isTrue(CraftSpawnCategory.isValidForLimits(spawnCategory), "SpawnCategory." + spawnCategory + " are not supported.");
int limit = spawnCategoryLimit.getInt(spawnCategory); int limit = spawnCategoryLimit.getOrDefault(spawnCategory, -1);
if (limit < 0) { if (limit < 0) {
limit = server.getSpawnLimit(spawnCategory); limit = server.getSpawnLimit(spawnCategory);
} }