Paper/patches/server-remapped/0115-Remove-FishingHook-reference-on-Craft-Entity-removal.patch
Mariell Hoversholm a207d14a0e
Rename all patches to correct numbering scheme
Signed-off-by: Mariell Hoversholm <proximyst@proximyst.com>
2021-06-11 15:46:44 +02:00

26 Zeilen
1.0 KiB
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 5668facc5bf5c56581c3ebd268f832d77ce5c05b..50322cfc07a7d93c32461faeb5e22e35ceead323 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().currentState.ordinal()];
}
+
+ // Paper start
+ @Override
+ public void remove() {
+ super.remove();
+ if (getHandle().getPlayerOwner() != null) {
+ getHandle().getPlayerOwner().fishing = null;
+ }
+ }
+ // Paper end
}