2018-07-19 12:42:43 +08:00
|
|
|
From 66b8e5de50e36ee6f046f28135d963376827f17e Mon Sep 17 00:00:00 2001
|
2018-07-18 08:37:30 +08: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
|
2018-07-18 12:52:33 +08:00
|
|
|
index 154202700..64b1ac71b 100644
|
2018-07-18 08:37:30 +08:00
|
|
|
--- a/src/main/java/net/minecraft/server/PathfinderGoalTempt.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderGoalTempt.java
|
2018-07-18 12:52:33 +08:00
|
|
|
@@ -52,7 +52,7 @@ public class PathfinderGoalTempt extends PathfinderGoal {
|
2018-07-18 08:37:30 +08: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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--
|
|
|
|
2.18.0
|
|
|
|
|