PaperMC/Spigot-Server-Patches/0180-Avoid-NPE-in-PathfinderGoalTempt.patch
2021-05-15 23:42:36 +00:00

19 lines
1,023 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/world/entity/ai/goal/PathfinderGoalTempt.java b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalTempt.java
index 54b345b5d2fc8d3c511533281f6d387f046f8000..9a120ab9c5c6c858bf3d1690196fe657e76cc1b7 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalTempt.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalTempt.java
@@ -65,7 +65,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
}
}