#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

@@ -26,6 +26,15 @@
private EntityFishingHook(World world, EntityHuman entityhuman, int i, int j) {
super(EntityTypes.FISHING_BOBBER, world);
this.b = new Random();
@@ -244,7 +256,7 @@
private void m() {
MovingObjectPosition movingobjectposition = ProjectileHelper.a((Entity) this, this::a);
- this.a(movingobjectposition);
+ this.preOnHit(movingobjectposition); // CraftBukkit - projectile hit event
}
@Override
@@ -291,6 +303,10 @@
this.waitTime = 0;
this.ai = 0;