Paper/patches/removed/1.17/No longer needed/0182-Avoid-NPE-in-PathfinderGoalTempt.patch
2021-06-14 19:54:17 -07:00

21 Zeilen
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
}
}