mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-07 03:10:50 +01:00
21 lines
1.2 KiB
Diff
21 lines
1.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
|
|
Date: Sat, 12 Feb 2022 12:40:50 -0700
|
|
Subject: [PATCH] Add missing Validate calls to CraftServer#getSpawnLimit
|
|
|
|
Copies appropriate checks from CraftWorld#getSpawnLimit
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
index 9f4d929e0e248cc2cc02ccb0c8915aeb6d9c03b5..630048f21d794cd2f5c10e7b1a7fca30a14e6856 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
@@ -2287,6 +2287,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) {
|