fix: scale breeding and spawn-egg caps with configured mob caps

This commit is contained in:
itsRevela
2026-04-18 10:15:33 -05:00
parent defd9ebd00
commit 7e586e0d49
3 changed files with 41 additions and 23 deletions
+11 -11
View File
@@ -4699,19 +4699,19 @@ bool Level::canCreateMore(eINSTANCEOF type, ESPAWN_TYPE spawnType)
break;
case eTYPE_CHICKEN:
count = countInstanceOf( eTYPE_CHICKEN, true);
max = MobCategory::MAX_XBOX_CHICKENS_WITH_SPAWN_EGG;
max = MobCategory::maxChickensWithSpawnEgg();
break;
case eTYPE_WOLF:
count = countInstanceOf( eTYPE_WOLF, true);
max = MobCategory::MAX_XBOX_WOLVES_WITH_SPAWN_EGG;
max = MobCategory::maxWolvesWithSpawnEgg();
break;
case eTYPE_MUSHROOMCOW:
count = countInstanceOf( eTYPE_MUSHROOMCOW, true);
max = MobCategory::MAX_XBOX_MUSHROOMCOWS_WITH_SPAWN_EGG;
max = MobCategory::maxMushroomCowsWithSpawnEgg();
break;
case eTYPE_SQUID:
count = countInstanceOf( eTYPE_SQUID, true);
max = MobCategory::MAX_XBOX_SQUIDS_WITH_SPAWN_EGG;
max = MobCategory::maxSquidsWithSpawnEgg();
break;
case eTYPE_SNOWMAN:
count = countInstanceOf( eTYPE_SNOWMAN, true);
@@ -4729,18 +4729,18 @@ bool Level::canCreateMore(eINSTANCEOF type, ESPAWN_TYPE spawnType)
if((type & eTYPE_ANIMALS_SPAWN_LIMIT_CHECK) == eTYPE_ANIMALS_SPAWN_LIMIT_CHECK)
{
count = countInstanceOf( eTYPE_ANIMALS_SPAWN_LIMIT_CHECK, false);
max = MobCategory::MAX_XBOX_ANIMALS_WITH_SPAWN_EGG;
max = MobCategory::maxAnimalsWithSpawnEgg();
}
// 4J: Use eTYPE_ENEMY instead of monster (slimes and ghasts aren't monsters)
else if(Entity::instanceof(type, eTYPE_ENEMY))
{
count = countInstanceOf(eTYPE_ENEMY, false);
max = MobCategory::MAX_XBOX_MONSTERS_WITH_SPAWN_EGG;
max = MobCategory::maxMonstersWithSpawnEgg();
}
else if( (type & eTYPE_AMBIENT) == eTYPE_AMBIENT)
{
count = countInstanceOf( eTYPE_AMBIENT, false);
max = MobCategory::MAX_AMBIENT_WITH_SPAWN_EGG;
max = MobCategory::maxAmbientWithSpawnEgg();
}
// 4J: Added minecart and boats
else if (Entity::instanceof(type, eTYPE_MINECART))
@@ -4765,21 +4765,21 @@ bool Level::canCreateMore(eINSTANCEOF type, ESPAWN_TYPE spawnType)
break;
case eTYPE_CHICKEN:
count = countInstanceOf( eTYPE_CHICKEN, true);
max = MobCategory::MAX_XBOX_CHICKENS_WITH_BREEDING;
max = MobCategory::maxChickensWithBreeding();
break;
case eTYPE_WOLF:
count = countInstanceOf( eTYPE_WOLF, true);
max = MobCategory::MAX_XBOX_WOLVES_WITH_BREEDING;
max = MobCategory::maxWolvesWithBreeding();
break;
case eTYPE_MUSHROOMCOW:
count = countInstanceOf( eTYPE_MUSHROOMCOW, true);
max = MobCategory::MAX_XBOX_MUSHROOMCOWS_WITH_BREEDING;
max = MobCategory::maxMushroomCowsWithBreeding();
break;
default:
if((type & eTYPE_ANIMALS_SPAWN_LIMIT_CHECK) == eTYPE_ANIMALS_SPAWN_LIMIT_CHECK)
{
count = countInstanceOf( eTYPE_ANIMALS_SPAWN_LIMIT_CHECK, false);
max = MobCategory::MAX_XBOX_ANIMALS_WITH_BREEDING;
max = MobCategory::maxAnimalsWithBreeding();
}
else if( (type & eTYPE_MONSTER) == eTYPE_MONSTER)
{