3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 20:40:08 +01:00

Fix animal spawning ignoring limits. Fixes BUKKIT-4180

Minecraft 1.5.2 changed mob spawning by ignoring persistent mobs from the
mob count. In CraftBukkit all mobs that previously used a separate hard
coded persistence system were ported to instead use this one. This causes
all animals to be persistent by default and thus never be counted. To
correct this issue we consider if the mob would be considered persistent
in the hard coded system as well when deciding if a mob should count.
Dieser Commit ist enthalten in:
Travis Watkins 2013-05-02 12:06:55 -05:00
Ursprung 401a6809be
Commit 25ca3f41af

Datei anzeigen

@ -2337,9 +2337,18 @@ public abstract class World implements IBlockAccess {
for (int j = 0; j < this.entityList.size(); ++j) {
Entity entity = (Entity) this.entityList.get(j);
if ((!(entity instanceof EntityLiving) || !((EntityLiving) entity).bU()) && oclass.isAssignableFrom(entity.getClass())) {
// CraftBukkit start - Split out persistent check, don't apply it to special persistent mobs
if (entity instanceof EntityLiving) {
EntityLiving entityliving = (EntityLiving) entity;
if (!entityliving.isTypeNotPersistent() && entityliving.bU()) { // Should be isPersistent
continue;
}
}
if (oclass.isAssignableFrom(entity.getClass())) {
++i;
}
// CraftBukkit end
}
return i;