From 45adbd9c6f4fd2fb2d971192904be21f01a70097 Mon Sep 17 00:00:00 2001 From: Matthew Date: Tue, 15 Mar 2016 09:26:45 -0400 Subject: [PATCH] SPIGOT-1931: Call PlayerFishEvent before modifying hooked entities velocity --- nms-patches/EntityFishingHook.patch | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/nms-patches/EntityFishingHook.patch b/nms-patches/EntityFishingHook.patch index 855c7e6f83..4fabdd7367 100644 --- a/nms-patches/EntityFishingHook.patch +++ b/nms-patches/EntityFishingHook.patch @@ -46,10 +46,10 @@ this.motY -= 0.20000000298023224D; this.a(SoundEffects.G, 0.25F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F); f2 = (float) MathHelper.floor(this.getBoundingBox().b); -@@ -391,6 +409,14 @@ - this.k(); - this.world.broadcastEntityEffect(this, (byte) 31); - i = this.hooked instanceof EntityItem ? 3 : 5; +@@ -388,6 +406,14 @@ + int i = 0; + + if (this.hooked != null) { + // CraftBukkit start + PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) this.owner.getBukkitEntity(), this.hooked.getBukkitEntity(), (Fish) this.getBukkitEntity(), PlayerFishEvent.State.CAUGHT_ENTITY); + this.world.getServer().getPluginManager().callEvent(playerFishEvent); @@ -58,9 +58,9 @@ + return 0; + } + // CraftBukkit end - } else if (this.au > 0) { - LootTableInfo.a loottableinfo_a = new LootTableInfo.a((WorldServer) this.world); - + this.k(); + this.world.broadcastEntityEffect(this, (byte) 31); + i = this.hooked instanceof EntityItem ? 3 : 5; @@ -400,6 +426,15 @@ while (iterator.hasNext()) { ItemStack itemstack = (ItemStack) iterator.next();