summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntityFishingHook.patch
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2016-03-05 15:46:56 +1100
committermd_5 <git@md-5.net>2016-03-05 15:46:56 +1100
commitdcc45717b9841fd14538c138c1a7409060dc9b07 (patch)
tree8e3c448bed680bfdc98d9e40a2867b96330f1249 /nms-patches/EntityFishingHook.patch
parentef13ca4444c53ec5fd844ab078c7dcbf0e1f0bbe (diff)
downloadcraftbukkit-dcc45717b9841fd14538c138c1a7409060dc9b07.tar
craftbukkit-dcc45717b9841fd14538c138c1a7409060dc9b07.tar.gz
craftbukkit-dcc45717b9841fd14538c138c1a7409060dc9b07.tar.lz
craftbukkit-dcc45717b9841fd14538c138c1a7409060dc9b07.tar.xz
craftbukkit-dcc45717b9841fd14538c138c1a7409060dc9b07.zip
SPIGOT-1751: Add missed PlayerFishEvent for FAILED_ATTEMPT
Diffstat (limited to 'nms-patches/EntityFishingHook.patch')
-rw-r--r--nms-patches/EntityFishingHook.patch13
1 files changed, 12 insertions, 1 deletions
diff --git a/nms-patches/EntityFishingHook.patch b/nms-patches/EntityFishingHook.patch
index 952bba1d..855c7e6f 100644
--- a/nms-patches/EntityFishingHook.patch
+++ b/nms-patches/EntityFishingHook.patch
@@ -77,7 +77,7 @@
double d0 = this.owner.locX - this.locX;
double d1 = this.owner.locY - this.locY;
double d2 = this.owner.locZ - this.locZ;
-@@ -410,13 +445,25 @@
+@@ -410,15 +445,36 @@
entityitem.motY = d1 * d4 + (double) MathHelper.sqrt(d3) * 0.08D;
entityitem.motZ = d2 * d4;
this.world.addEntity(entityitem);
@@ -103,4 +103,15 @@
+ // CraftBukkit end
i = 2;
}
++ // CraftBukkit start
++ if (i == 0) {
++ PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) this.owner.getBukkitEntity(), null, (Fish) this.getBukkitEntity(), PlayerFishEvent.State.FAILED_ATTEMPT);
++ this.world.getServer().getPluginManager().callEvent(playerFishEvent);
++ if (playerFishEvent.isCancelled()) {
++ return 0;
++ }
++ }
++ // CraftBukkit end
+ this.die();
+ this.owner.hookedFish = null;