Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/mcmonkey4eva/Denizen
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Nov 19, 2016
2 parents efce1d6 + 12c14b8 commit 9d6873d
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public EntityItemProjectile_v1_11_R1(CraftWorld craftWorld, Location location, o

@Override
public void A_() {
this.U();
super.U();
BlockPosition blockposition = new BlockPosition(locX, locY, locZ);
IBlockData iblockdata = world.getType(blockposition);
Block block = iblockdata.getBlock();
Expand Down Expand Up @@ -78,13 +78,21 @@ public void A_() {
}
if ((movingobjectposition != null) && (movingobjectposition.entity != null) && ((movingobjectposition.entity instanceof EntityHuman))) {
EntityHuman entityhuman = (EntityHuman) movingobjectposition.entity;
if ((entityhuman.abilities.isInvulnerable) || (((shooter instanceof EntityHuman)) && (!((EntityHuman) shooter).a(entityhuman)))) {
if(shooter instanceof EntityHuman && !((EntityHuman) shooter).a(entityhuman)) {
movingobjectposition = null;
}
}
if (movingobjectposition != null) {
if (movingobjectposition.entity != null && movingobjectposition.entity instanceof EntityLiving) {
movingobjectposition.entity.damageEntity(DamageSource.projectile(this, this.getShooter()), 0F);
CraftEventFactory.callProjectileHitEvent(this);
DamageSource damageSource;
if(this.shooter == null) {
damageSource = DamageSource.projectile(this, this);
}
else {
damageSource = DamageSource.projectile(this, this.shooter);
}
if (movingobjectposition.entity != null) {
movingobjectposition.entity.damageEntity(damageSource, 0F);
this.die();
}
else if (movingobjectposition.a() != null) {
Expand All @@ -96,7 +104,6 @@ else if (movingobjectposition.a() != null) {
locX -= motX / f3 * 0.0500000007450581D;
locY -= motY / f3 * 0.0500000007450581D;
locZ -= motZ / f3 * 0.0500000007450581D;
CraftEventFactory.callProjectileHitEvent(this);
this.die();
}
}
Expand Down

0 comments on commit 9d6873d

Please sign in to comment.