From 3ffe018032c041c807d0ad1db2049f5585cbac99 Mon Sep 17 00:00:00 2001 From: Spigot Date: Sun, 13 Apr 2014 20:13:56 +1000 Subject: [PATCH] Properly cancel fishing event. Fixes BUKKIT-5396 Previously, when cancelling a PlayerFishEvent with State.FISHING, the next fishing attempt would automatically result in a new PlayerFishEvent with State.FAILED_ATTEMPT because the player's hooked entity was not properly cleared. This ensures that the player's hooked entity value is set to null so that the next attempt will result in the proper state being called. By: gjmcferrin@gmail.com --- ...cel-fishing-event.-Fixes-BUKKIT-5396.patch | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 CraftBukkit-Patches/0129-Properly-cancel-fishing-event.-Fixes-BUKKIT-5396.patch diff --git a/CraftBukkit-Patches/0129-Properly-cancel-fishing-event.-Fixes-BUKKIT-5396.patch b/CraftBukkit-Patches/0129-Properly-cancel-fishing-event.-Fixes-BUKKIT-5396.patch new file mode 100644 index 0000000000..c5d6d9405e --- /dev/null +++ b/CraftBukkit-Patches/0129-Properly-cancel-fishing-event.-Fixes-BUKKIT-5396.patch @@ -0,0 +1,26 @@ +From c72b56ce01b9737d0afe6c5a1cb3f82f99ba7238 Mon Sep 17 00:00:00 2001 +From: "gjmcferrin@gmail.com" +Date: Mon, 10 Feb 2014 10:05:11 -0500 +Subject: [PATCH] Properly cancel fishing event. Fixes BUKKIT-5396 + +Previously, when cancelling a PlayerFishEvent with State.FISHING, the next +fishing attempt would automatically result in a new PlayerFishEvent with +State.FAILED_ATTEMPT because the player's hooked entity was not properly +cleared. This ensures that the player's hooked entity value is set to null so +that the next attempt will result in the proper state being called. + +diff --git a/src/main/java/net/minecraft/server/ItemFishingRod.java b/src/main/java/net/minecraft/server/ItemFishingRod.java +index 4451a9f..3ced72b 100644 +--- a/src/main/java/net/minecraft/server/ItemFishingRod.java ++++ b/src/main/java/net/minecraft/server/ItemFishingRod.java +@@ -23,6 +23,7 @@ public class ItemFishingRod extends Item { + world.getServer().getPluginManager().callEvent(playerFishEvent); + + if (playerFishEvent.isCancelled()) { ++ entityhuman.hookedFish = null; + return itemstack; + } + // CraftBukkit end +-- +1.8.3.2 +