Add missing Validate calls to CraftServer#getSpawnLimit

Copies appropriate checks from CraftWorld#getSpawnLimit
This commit is contained in:
Jason Penilla 2022-02-12 12:40:50 -07:00
parent 140e68625c
commit fd7f4e0d1a

View File

@ -2342,6 +2342,8 @@ public final class CraftServer implements Server {
@Override
public int getSpawnLimit(SpawnCategory spawnCategory) {
// Paper start - Add mobcaps commands
Preconditions.checkArgument(spawnCategory != null, "SpawnCategory cannot be null");
Preconditions.checkArgument(CraftSpawnCategory.isValidForLimits(spawnCategory), "SpawnCategory." + spawnCategory + " does not have a spawn limit.");
return this.getSpawnLimitUnsafe(spawnCategory);
}
public int getSpawnLimitUnsafe(final SpawnCategory spawnCategory) {