mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
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.
This commit is contained in:
parent
603ab21457
commit
669007b2f6
1 changed files with 41 additions and 0 deletions
|
@ -0,0 +1,41 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
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/PaperWorldEntityList.java b/src/main/java/com/destroystokyo/paper/PaperWorldEntityList.java
|
||||
index a10a5bc138..8ad00c7d11 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldEntityList.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldEntityList.java
|
||||
@@ -0,0 +0,0 @@ import net.minecraft.server.IAnimal;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.World;
|
||||
import net.minecraft.server.WorldServer;
|
||||
+import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@@ -0,0 +0,0 @@ public class PaperWorldEntityList extends ArrayList<Entity> {
|
||||
}
|
||||
|
||||
public void updateEntityCount(Entity entity, int amt) {
|
||||
- if (!(entity instanceof IAnimal)) return;
|
||||
+ // Only count natural spawns so that mob
|
||||
+ if (!(entity instanceof IAnimal) || entity.spawnReason != SpawnReason.NATURAL) return;
|
||||
|
||||
if (entity instanceof EntityInsentient) {
|
||||
EntityInsentient entityinsentient = (EntityInsentient) entity;
|
||||
--
|
Loading…
Reference in a new issue