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 diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index bbc5d6834e52d2fb92fd41156ba0ae0600282b59..6aa21f31b5d766cf6c9a94243dde652fbcb3cc61 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -226,6 +226,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