2020-04-02 23:07:06 +02:00
|
|
|
From 2b3b0cbd50b62a4cbb5aefd0b332e23b44e6caef Mon Sep 17 00:00:00 2001
|
2018-07-18 02:37:30 +02:00
|
|
|
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
|
2020-04-02 23:07:06 +02:00
|
|
|
index eafdcb916a..d37a2fa0ab 100644
|
2018-07-18 02:37:30 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalTempt.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalTempt.java
|
2019-04-28 01:23:53 +02:00
|
|
|
@@ -55,7 +55,7 @@ public class PathfinderGoalTempt extends PathfinderGoal {
|
2018-07-18 02:37:30 +02:00
|
|
|
}
|
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--
|
2020-04-02 23:07:06 +02:00
|
|
|
2.25.1
|
2018-07-18 02:37:30 +02:00
|
|
|
|