--- a/net/minecraft/server/EntityProjectile.java
+++ b/net/minecraft/server/EntityProjectile.java
@@ -35,6 +35,7 @@
public EntityProjectile(World world, EntityLiving entityliving) {
this(world, entityliving.locX, entityliving.locY + (double) entityliving.getHeadHeight() - 0.10000000149011612D, entityliving.locZ);
this.shooter = entityliving;
+ this.projectileSource = (org.bukkit.entity.LivingEntity) entityliving.getBukkitEntity(); // CraftBukkit
}
protected void i() {}
@@ -127,7 +128,7 @@
if (entity1.isInteractable()) {
if (entity1 == this.c) {
flag = true;
- } else if (this.shooter != null && this.ticksLived < 2 && this.c == null) {
+ } else if (this.shooter != null && this.ticksLived < 2 && this.c == null && this.shooter == entity1) { // CraftBukkit - MC-88491
this.c = entity1;
} else {
@@ -164,6 +165,11 @@
this.e(movingobjectposition.a());
this.a(movingobjectposition);
+ // CraftBukkit start
+ if (this.dead) {
+ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition);
+ }
+ // CraftBukkit end