2019-03-20 02:46:00 +01:00
|
|
|
From 6aedfbae82f449bae1366f7c09bc1f46d2c68806 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
|
2019-03-20 02:46:00 +01:00
|
|
|
index 5cf9b1896..1f3ae55a0 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
|
2018-07-18 06:52:33 +02:00
|
|
|
@@ -52,7 +52,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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--
|
2019-03-20 02:46:00 +01:00
|
|
|
2.21.0
|
2018-07-18 02:37:30 +02:00
|
|
|
|