#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

@@ -13,6 +13,15 @@
public abstract class EntityArrow extends IProjectile {
private static final DataWatcherObject<Byte> f = DataWatcher.a(EntityArrow.class, DataWatcherRegistry.a);
@@ -181,7 +187,7 @@
}
if (object != null && !flag) {
- this.a((MovingObjectPosition) object);
+ this.preOnHit((MovingObjectPosition) object); // CraftBukkit - projectile hit event
this.impulse = true;
}
@@ -328,7 +334,13 @@
int k = entity.getFireTicks();