mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-25 20:16:19 +01:00
21 lines
1011 B
Diff
21 lines
1011 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
|
|
Not needed anymore
|
|
similar check added by Mojang
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/TemptGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/TemptGoal.java
|
|
index 186025458e923d153e9e47c2be147a9bb53db517..11ca6a752bac4ba4bc683bef844d204b739fab63 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/ai/goal/TemptGoal.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/TemptGoal.java
|
|
@@ -63,7 +63,7 @@ public class TemptGoal extends Goal {
|
|
}
|
|
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
|
|
}
|
|
}
|