summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntityProjectile.patch
blob: f5c27ca285763f713bf7a3d8b437cc64870fd690 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- a/net/minecraft/server/EntityProjectile.java
+++ b/net/minecraft/server/EntityProjectile.java
@@ -34,6 +34,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() {}
@@ -161,6 +162,11 @@
                 this.e(movingobjectposition.a());
             } else {
                 this.a(movingobjectposition);
+                // CraftBukkit start
+                if (this.dead) {
+                    org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this);
+                }
+                // CraftBukkit end
             }
         }