From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: chase 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 bc2c56b0a3ea8e9107c3ef798bb058ae1ff41652..6c91471b5459ca45b532934d25c682ddc5b00042 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -215,6 +215,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