aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0581-add-per-world-spawn-limits.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0581-add-per-world-spawn-limits.patch')
-rw-r--r--patches/server/0581-add-per-world-spawn-limits.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/patches/server/0581-add-per-world-spawn-limits.patch b/patches/server/0581-add-per-world-spawn-limits.patch
new file mode 100644
index 0000000000..5433a49ee8
--- /dev/null
+++ b/patches/server/0581-add-per-world-spawn-limits.patch
@@ -0,0 +1,24 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: chase <[email protected]>
+Date: Wed, 2 Dec 2020 22:43:39 -0800
+Subject: [PATCH] add per world spawn limits
+
+
+diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+index 05b9e7011d1c127052b73a464fc86331e2a4774a..fce62b18da2d6ee8d10688107ca3179abfa3781b 100644
+--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
++++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+@@ -221,6 +221,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
+ this.biomeProvider = biomeProvider;
+
+ this.environment = env;
++ // Paper start - per world spawn limits
++ for (SpawnCategory spawnCategory : SpawnCategory.values()) {
++ if (CraftSpawnCategory.isValidForLimits(spawnCategory)) {
++ setSpawnLimit(spawnCategory, this.world.paperConfig().entities.spawning.spawnLimits.getInt(CraftSpawnCategory.toNMS(spawnCategory)));
++ }
++ }
++ // Paper end - per world spawn limits
+ }
+
+ @Override