mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-30 19:52:06 -07:00
Add missing Validate calls to CraftServer#getSpawnLimit
Copies appropriate checks from CraftWorld#getSpawnLimit
This commit is contained in:
@@ -2342,6 +2342,8 @@ public final class CraftServer implements Server {
|
|||||||
@Override
|
@Override
|
||||||
public int getSpawnLimit(SpawnCategory spawnCategory) {
|
public int getSpawnLimit(SpawnCategory spawnCategory) {
|
||||||
// Paper start - Add mobcaps commands
|
// 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);
|
return this.getSpawnLimitUnsafe(spawnCategory);
|
||||||
}
|
}
|
||||||
public int getSpawnLimitUnsafe(final SpawnCategory spawnCategory) {
|
public int getSpawnLimitUnsafe(final SpawnCategory spawnCategory) {
|
||||||
|
Reference in New Issue
Block a user