aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0160-Remove-FishingHook-reference-on-Craft-Entity-removal.patch
blob: c229a9d4f83ece383c68f704d09dd01806377ad6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From 3d9463bc18a705c0db7d39ee52b12b52c5ecb4fe 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/CraftFish.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFish.java
index ecfc316bb..3f909c174 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFish.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFish.java
@@ -64,6 +64,16 @@ public class CraftFish extends AbstractProjectile implements Fish {
         this.biteChance = chance;
     }
 
+    // Paper start
+    @Override
+    public void remove() {
+        super.remove();
+        if (getHandle().owner != null) {
+            getHandle().owner.hookedFish = null;
+        }
+    }
+    // Paper end
+
     @Deprecated
     public LivingEntity _INVALID_getShooter() {
         return (LivingEntity) getShooter();
-- 
2.11.0