diff --git a/nms-patches/EntityArrow.patch b/nms-patches/EntityArrow.patch index f8c15319f1..656ebe0aeb 100644 --- a/nms-patches/EntityArrow.patch +++ b/nms-patches/EntityArrow.patch @@ -27,7 +27,7 @@ protected void a(MovingObjectPosition movingobjectposition) { Entity entity = movingobjectposition.entity; - -+ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this); // CraftBukkit - Call event ++ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition); // CraftBukkit - Call event if (entity != null) { float f = MathHelper.sqrt(this.motX * this.motX + this.motY * this.motY + this.motZ * this.motZ); int i = MathHelper.f((double) f * this.damage); diff --git a/nms-patches/EntityFireball.patch b/nms-patches/EntityFireball.patch index 02e43ed882..28389160c1 100644 --- a/nms-patches/EntityFireball.patch +++ b/nms-patches/EntityFireball.patch @@ -44,7 +44,7 @@ + + // CraftBukkit start - Fire ProjectileHitEvent + if (this.dead) { -+ CraftEventFactory.callProjectileHitEvent(this); ++ CraftEventFactory.callProjectileHitEvent(this, movingobjectposition); + } + // CraftBukkit end } diff --git a/nms-patches/EntityFishingHook.patch b/nms-patches/EntityFishingHook.patch index 8aea943992..7b0fbc62a4 100644 --- a/nms-patches/EntityFishingHook.patch +++ b/nms-patches/EntityFishingHook.patch @@ -16,7 +16,7 @@ } if (movingobjectposition != null && movingobjectposition.type != MovingObjectPosition.EnumMovingObjectType.MISS) { -+ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this); // Craftbukkit - Call event ++ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition); // Craftbukkit - Call event if (movingobjectposition.type == MovingObjectPosition.EnumMovingObjectType.ENTITY) { this.hooked = movingobjectposition.entity; this.s(); diff --git a/nms-patches/EntityProjectile.patch b/nms-patches/EntityProjectile.patch index 5e01a87cc7..17b70ac121 100644 --- a/nms-patches/EntityProjectile.patch +++ b/nms-patches/EntityProjectile.patch @@ -14,7 +14,7 @@ this.a(movingobjectposition); + // CraftBukkit start + if (this.dead) { -+ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this); ++ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition); + } + // CraftBukkit end } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index 3d3ea63118..2621b777db 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -778,8 +778,8 @@ public class CraftEventFactory { return event; } - public static ProjectileHitEvent callProjectileHitEvent(Entity entity) { - ProjectileHitEvent event = new ProjectileHitEvent((Projectile) entity.getBukkitEntity()); + public static ProjectileHitEvent callProjectileHitEvent(Entity entity, MovingObjectPosition position) { + ProjectileHitEvent event = new ProjectileHitEvent((Projectile) entity.getBukkitEntity(), position.entity == null ? null : position.entity.getBukkitEntity()); entity.world.getServer().getPluginManager().callEvent(event); return event; }