Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-16 04:50:05 +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:
Ursprung
401a6809be
Commit
25ca3f41af
@ -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;
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren