2015-01-05 04:32:01 +01:00
|
|
|
From 5a48c23d5d6dfdefbc340caf1aca06e993cea170 Mon Sep 17 00:00:00 2001
|
2014-07-21 22:46:54 +02:00
|
|
|
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
|
2014-11-28 02:17:45 +01:00
|
|
|
index 423a776..c14d261 100644
|
2014-07-21 22:46:54 +02:00
|
|
|
--- 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
|
|
|
|
--
|
2014-11-28 02:17:45 +01:00
|
|
|
2.1.0
|
2014-07-21 22:46:54 +02:00
|
|
|
|