Hopefully fixing the phantoms suffocating players in walls.

This commit is contained in:
Amnet 2013-10-11 17:52:13 +02:00
parent b66dceb7e3
commit 937374350a
2 changed files with 6 additions and 5 deletions

View File

@ -88,7 +88,7 @@ public class BOPEntities {
if (Biomes.netherBone.isPresent() && Biomes.netherDesert.isPresent())
{
EntityRegistry.addSpawn(EntityPhantom.class, 65, 1, 1, EnumCreatureType.monster, Biomes.netherBone.get(), Biomes.netherDesert.get());
EntityRegistry.addSpawn(EntityPhantom.class, 8, 1, 1, EnumCreatureType.monster, Biomes.netherBone.get(), Biomes.netherDesert.get());
}
}
}

View File

@ -40,9 +40,9 @@ public class PotionEventHandler
double posY = event.entityLiving.posY;
double posZ = event.entityLiving.posZ;
double randX = (double)rand.nextInt(2);
double randY = (double)rand.nextInt(3);
double randZ = (double)rand.nextInt(2);
double randX = 1.0 - (rand.nextDouble() * 2.0);
double randY = (double) rand.nextInt(3);
double randZ = 1.0 - (rand.nextDouble() * 2.0);
event.entityLiving.motionX = 0.0;
event.entityLiving.motionY = 0.0;
@ -50,7 +50,8 @@ public class PotionEventHandler
if (rand.nextInt(5) == 0)
{
event.entityLiving.setPosition(posX + randX, posY + randY, posZ + randZ);
if (!event.entityLiving.worldObj.checkBlockCollision(event.entityLiving.boundingBox.offset(randX, randY, randZ)))
event.entityLiving.setPosition(posX + randX, posY + randY, posZ + randZ);
}
if (event.entityLiving.getActivePotionEffect(Potions.possession.get()).getDuration() == 0)