From 3f201cda06e342ccc05fb1edf1b6d8be27bbc971 Mon Sep 17 00:00:00 2001 From: kickash32 Date: Wed, 12 Jun 2019 21:54:16 -0400 Subject: [PATCH] Create 0402-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch delete old patch Comment didn't make sense Use original header use original date in header --- ...al-Spawned-mobs-towards-natural-spaw.patch | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 Spigot-Server-Patches/Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch diff --git a/Spigot-Server-Patches/Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch b/Spigot-Server-Patches/Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch new file mode 100644 index 0000000000..66728cd294 --- /dev/null +++ b/Spigot-Server-Patches/Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch @@ -0,0 +1,58 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Sun, 24 Mar 2019 01:01:32 -0400 +Subject: [PATCH] Only count Natural Spawned mobs towards natural spawn mob + limit + +This resolves the super common complaint about mobs not spawning. + +This was ultimately a flaw in the vanilla count algorithim that allows +spawners and other misc mobs to count against the mob limit, which are +not bounded, and can prevent the entire world from spawning new. + +I believe Bukkits changes around persistence may of actually made it +worse than vanilla. + +This should fully solve all of the issues around it so that only natural +influences natural spawns. + +diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +index 929f5c303..ff520d9e8 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +@@ -0,0 +0,0 @@ public class PaperWorldConfig { + maxAutoSaveChunksPerTick = getInt("max-auto-save-chunks-per-tick", 24); + } + ++ public boolean countAllMobsForSpawning = false; ++ private void countAllMobsForSpawning() { ++ countAllMobsForSpawning = getBoolean("count-all-mobs-for-spawning", false); ++ if (countAllMobsForSpawning) { ++ log("Counting all mobs for spawning. Mob farms may reduce natural spawns elsewhere in world."); ++ } else { ++ log("Using improved mob spawn limits (Only Natural Spawns impact spawn limits for more natural spawns)"); ++ } ++ } ++ + public boolean antiXray; + public boolean asynchronous; + public EngineMode engineMode; +diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java +index c646393eb..959fc99bb 100644 +--- a/src/main/java/net/minecraft/server/WorldServer.java ++++ b/src/main/java/net/minecraft/server/WorldServer.java +@@ -0,0 +0,0 @@ public class WorldServer extends World { + EnumCreatureType enumcreaturetype = entity.getEntityType().d(); + + if (enumcreaturetype != EnumCreatureType.MISC && this.getChunkProvider().b(entity)) { ++ // Paper start - Only count natural spawns ++ if (!this.paperConfig.countAllMobsForSpawning && ++ !(entity.spawnReason == CreatureSpawnEvent.SpawnReason.NATURAL || ++ entity.spawnReason == CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) { ++ continue; ++ } ++ // Paper end + object2intmap.mergeInt(enumcreaturetype, 1, Integer::sum); + } + } +-- \ No newline at end of file