aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0977-Prevent-NPE-if-hooked-entity-was-cleared.patch
diff options
context:
space:
mode:
authorSpottedleaf <[email protected]>2024-07-17 10:24:53 -0700
committerSpottedleaf <[email protected]>2024-07-17 10:28:32 -0700
commit00b949f1bbbf444e2b5e7b8de7c9b14fbd2133c6 (patch)
tree82639515bc5e9ae00c1e639e72137ed51e1ac688 /patches/server/0977-Prevent-NPE-if-hooked-entity-was-cleared.patch
parent967f98aa81da851740aeb429778e46159fd188df (diff)
downloadPaper-00b949f1bbbf444e2b5e7b8de7c9b14fbd2133c6.tar.gz
Paper-00b949f1bbbf444e2b5e7b8de7c9b14fbd2133c6.zip
Remove Moonrise utils to MCUtils, remove duplicated/unused utils
Diffstat (limited to 'patches/server/0977-Prevent-NPE-if-hooked-entity-was-cleared.patch')
-rw-r--r--patches/server/0977-Prevent-NPE-if-hooked-entity-was-cleared.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/patches/server/0977-Prevent-NPE-if-hooked-entity-was-cleared.patch b/patches/server/0977-Prevent-NPE-if-hooked-entity-was-cleared.patch
new file mode 100644
index 0000000000..8d3547db93
--- /dev/null
+++ b/patches/server/0977-Prevent-NPE-if-hooked-entity-was-cleared.patch
@@ -0,0 +1,24 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jake Potrebic <[email protected]>
+Date: Sun, 12 May 2024 21:57:23 -0700
+Subject: [PATCH] Prevent NPE if hooked entity was cleared
+
+
+diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
+index 270f4c94912b16c7d4a2d62670847cbb5e011819..6ce65e5b336be9b49db84f1c4755c2e2ce7f8378 100644
+--- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
++++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
+@@ -504,11 +504,13 @@ public class FishingHook extends Projectile {
+ if (playerFishEvent.isCancelled()) {
+ return 0;
+ }
++ if (this.hookedIn != null) { // Paper - re-check to see if there is a hooked entity
+ // CraftBukkit end
+ this.pullEntity(this.hookedIn);
+ CriteriaTriggers.FISHING_ROD_HOOKED.trigger((ServerPlayer) entityhuman, usedItem, this, Collections.emptyList());
+ this.level().broadcastEntityEvent(this, (byte) 31);
+ i = this.hookedIn instanceof ItemEntity ? 3 : 5;
++ } // Paper - re-check to see if there is a hooked entity
+ } else if (this.nibble > 0) {
+ LootParams lootparams = (new LootParams.Builder((ServerLevel) this.level())).withParameter(LootContextParams.ORIGIN, this.position()).withParameter(LootContextParams.TOOL, usedItem).withParameter(LootContextParams.THIS_ENTITY, this).withLuck((float) this.luck + entityhuman.getLuck()).create(LootContextParamSets.FISHING);
+ LootTable loottable = this.level().getServer().reloadableRegistries().getLootTable(BuiltInLootTables.FISHING);