Paper/Spigot-Server-Patches/0182-Avoid-NPE-in-PathfinderGoalTempt.patch
Aikar b6925c36af
Remove no longer needed undead horse leash patch
This is now default vanilla behavior

Fixes #3644
2020-06-28 04:35:41 -04:00

20 lines
967 B
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 29 Nov 2017 22:18:54 -0500
Subject: [PATCH] Avoid NPE in PathfinderGoalTempt
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalTempt.java b/src/main/java/net/minecraft/server/PathfinderGoalTempt.java
index 351152ae32e162fa912d60e929abeec783140106..b115f40b0b11e89184960a5cce5b8295030469e9 100644
--- a/src/main/java/net/minecraft/server/PathfinderGoalTempt.java
+++ b/src/main/java/net/minecraft/server/PathfinderGoalTempt.java
@@ -55,7 +55,7 @@ public class PathfinderGoalTempt extends PathfinderGoal {
}
this.target = (event.getTarget() == null) ? null : ((CraftLivingEntity) event.getTarget()).getHandle();
}
- return tempt;
+ return tempt && this.target != null; // Paper - must have target - plugin might of cancelled
// CraftBukkit end
}
}