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.
This commit is contained in:
parent
c6140eafcc
commit
c9c88ab4c8
@ -0,0 +1,26 @@
|
|||||||
|
From c72b56ce01b9737d0afe6c5a1cb3f82f99ba7238 Mon Sep 17 00:00:00 2001
|
||||||
|
From: "gjmcferrin@gmail.com" <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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user