#776: Add ability to cancel ProjectileHitEvent

By: Martoph <sager1018@gmail.com>
This commit is contained in:
CraftBukkit/Spigot
2021-05-09 16:51:44 +10:00
parent 9d5bc88891
commit 3df6aee27f
9 changed files with 101 additions and 9 deletions

View File

@@ -22,6 +22,15 @@
@Override
public SoundCategory getSoundCategory() {
return SoundCategory.HOSTILE;
@@ -218,7 +231,7 @@
MovingObjectPosition movingobjectposition = ProjectileHelper.a((Entity) this, this::a);
if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) {
- this.a(movingobjectposition);
+ this.preOnHit(movingobjectposition); // CraftBukkit - projectile hit event
}
}
@@ -280,7 +293,7 @@
if (flag) {
this.a(entityliving, entity);