Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-15 11:00:06 +01:00
7b0c576798
Allows us much greater control over the Spigot portion of the code and makes us more "proper" Credit to @Dmck2b for originally passing the idea along a while back
27 Zeilen
1.2 KiB
Diff
27 Zeilen
1.2 KiB
Diff
From a5301c591ee9b8080f46018ae8cf232c5f59f31b 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 2f34151..9ededf3 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.9.1
|
|
|