testserver/CraftBukkit-Patches/0088-Properly-cancel-fishin...

27 lines
1.2 KiB
Diff
Raw Normal View History

2016-03-01 00:23:45 +00:00
From 53a7065d5efcc84f18359165baf714339760f67e 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
2016-02-29 21:33:06 +00:00
index 19f5f03..1a40b95 100644
--- a/src/main/java/net/minecraft/server/ItemFishingRod.java
+++ b/src/main/java/net/minecraft/server/ItemFishingRod.java
2016-02-29 21:33:06 +00:00
@@ -25,6 +25,7 @@ public class ItemFishingRod extends Item {
world.getServer().getPluginManager().callEvent(playerFishEvent);
if (playerFishEvent.isCancelled()) {
+ entityhuman.hookedFish = null;
2016-02-29 21:33:06 +00:00
return new InteractionResultWrapper(EnumInteractionResult.PASS, itemstack);
}
// CraftBukkit end
--
2016-02-29 21:33:06 +00:00
2.5.0