SPIGOT-3482: ProjectileHitEvent for shulker bullet and llama spit

This commit is contained in:
md_5 2017-08-02 18:05:28 +10:00
parent 2c5c611d0c
commit 86aa17fae1
2 changed files with 16 additions and 0 deletions

View File

@ -9,3 +9,11 @@
private NBTTagCompound b;
public EntityLlamaSpit(World world) {
@@ -143,6 +143,7 @@
}
public void a(MovingObjectPosition movingobjectposition) {
+ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition); // Craftbukkit - Call event
if (movingobjectposition.entity != null && this.shooter != null) {
movingobjectposition.entity.damageEntity(DamageSource.a(this, this.shooter).b(), 1.0F);
}

View File

@ -30,3 +30,11 @@
protected void b(NBTTagCompound nbttagcompound) {
BlockPosition blockposition;
NBTTagCompound nbttagcompound1;
@@ -287,6 +308,7 @@
}
protected void a(MovingObjectPosition movingobjectposition) {
+ org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition); // Craftbukkit - Call event
if (movingobjectposition.entity == null) {
((WorldServer) this.world).a(EnumParticle.EXPLOSION_LARGE, this.locX, this.locY, this.locZ, 2, 0.2D, 0.2D, 0.2D, 0.0D, new int[0]);
this.a(SoundEffects.gD, 1.0F, 1.0F);