fix for spawners not properly checking whether an entity can spawn

This commit is contained in:
Tahg 2011-10-05 11:09:41 -04:00
parent d74145ef23
commit 8ab90b344c

View File

@ -84,7 +84,8 @@ public class TileEntityMobSpawner extends TileEntity {
double d5 = (double) this.z + (this.world.random.nextDouble() - this.world.random.nextDouble()) * 4.0D;
entityliving.setPositionRotation(d3, d4, d5, this.world.random.nextFloat() * 360.0F, 0.0F);
if (entityliving.world.containsEntity(entityliving.boundingBox) && entityliving.world.getEntities(entityliving, entityliving.boundingBox).size() == 0 && !entityliving.world.c(entityliving.boundingBox)) {
if ((entityliving instanceof EntityLiving && ((EntityLiving)entityliving).d()) ||
(entityliving.world.containsEntity(entityliving.boundingBox) && entityliving.world.getEntities(entityliving, entityliving.boundingBox).size() == 0 && !entityliving.world.c(entityliving.boundingBox))) {
// CraftBukkit end
// CraftBukkit - added a reason for spawning this creature
this.world.addEntity(entityliving, SpawnReason.SPAWNER);