Paper/Spigot-Server-Patches/0250-Avoid-NPE-in-PathfinderGoalTempt.patch
Aikar b922ff9886
Fix issues with getBlockState(false) not loading Tile Entity data
This only impacted people who used our useSnapshots new API in a plugin,
which obviously was no one as the data result was completely broken.

Merged the NPE check patch into mine since it has to handle it too.
2018-06-30 01:40:52 -04:00

23 lines
917 B
Diff

From 32a109d078d259d8e4c16bb59ed385cdb0a86b83 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 188825d19..8004f3a3f 100644
--- a/src/main/java/net/minecraft/server/PathfinderGoalTempt.java
+++ b/src/main/java/net/minecraft/server/PathfinderGoalTempt.java
@@ -54,7 +54,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
}
}
--
2.18.0