Paper/Spigot-Server-Patches/0113-Remove-FishingHook-reference-on-Craft-Entity-removal.patch
Josh Roy b31089a929
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5325)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
d264e972 #591: Add option for a consumer before spawning an item
1c537fce #590: Add spawn and transform reasons for piglin zombification.

CraftBukkit Changes:
ee5006d1 #810: Add option for a consumer before spawning an item
f6a39d3c #809: Add spawn and transform reasons for piglin zombification.
0c24068a Organise imports

Spigot Changes:
bff52619 Organise imports
2021-03-08 15:12:31 -08:00

26 lines
1021 B
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 16 Jun 2016 00:17:23 -0400
Subject: [PATCH] Remove FishingHook reference on Craft Entity removal
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java
index f8e897f0bc4e5d0a432d20983fd37998bb00ae0f..b480ca876687991685b5e070181721da8192a5b6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java
@@ -119,4 +119,14 @@ public class CraftFishHook extends CraftProjectile implements FishHook {
public HookState getState() {
return HookState.values()[getHandle().hookState.ordinal()];
}
+
+ // Paper start
+ @Override
+ public void remove() {
+ super.remove();
+ if (getHandle().getOwner() != null) {
+ getHandle().getOwner().hookedFish = null;
+ }
+ }
+ // Paper end
}