mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-09 04:09:54 +01:00
1718f61bf8
Doesn't compile yet. CraftBukkit Changes: 90d6905b Repackage NMS 69cf961d Repackage patches Spigot Changes: 79d53c28 Repackage NMS
20 lines
1023 B
Diff
20 lines
1023 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
|
|
}
|
|
}
|