Archiviert
13
0
Dieses Repository wurde am 2024-12-25 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.
Paper-Old/patches/removed/1.18.2/0108-Remove-FishingHook-reference-on-Craft-Entity-removal.patch

28 Zeilen
1.2 KiB
Diff

2021-06-11 14:02:28 +02:00
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
2021-06-12 08:02:49 +02:00
TODO 1.17 isn't this supposed to be applied to when the fish hook is removed _in general_? Not just in Bukkit api calls?
2022-03-11 21:13:46 +01:00
No longer needed, fishing is set to null when FishingHook is removed.
2021-06-11 14:02:28 +02:00
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java
2021-06-12 08:02:49 +02:00
index 6bfa984781a483d048ef4318761203c701d8a632..3c18712040da8d6ece24fd817b7846836b8353c1 100644
2021-06-11 14:02:28 +02:00
--- 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() {
2021-06-12 08:02:49 +02:00
return HookState.values()[this.getHandle().currentState.ordinal()];
2021-06-11 14:02:28 +02:00
}
+
+ // Paper start
+ @Override
+ public void remove() {
+ super.remove();
+ if (getHandle().getPlayerOwner() != null) {
+ getHandle().getPlayerOwner().fishing = null;
+ }
+ }
+ // Paper end
}