diff options
Diffstat (limited to 'patches/server/0621-add-per-world-spawn-limits.patch')
-rw-r--r-- | patches/server/0621-add-per-world-spawn-limits.patch | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/patches/server/0621-add-per-world-spawn-limits.patch b/patches/server/0621-add-per-world-spawn-limits.patch new file mode 100644 index 0000000000..5a0bee4c61 --- /dev/null +++ b/patches/server/0621-add-per-world-spawn-limits.patch @@ -0,0 +1,25 @@ +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 + +Taken from #2982. Credit to Chasewhip8 + +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +index a50a9f239ef27807d876aca9b18fbbb1dfbb14fa..b69c0e32965b3ed5b3e41d7cdee6f07b572d2b7c 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +@@ -213,6 +213,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 + } + + @Override |