mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-23 07:51:52 +01:00
Avoid NPE in PathfinderGoalTempt
This commit is contained in:
parent
149f6e1511
commit
93477a5b68
20
Spigot-Server-Patches/Avoid-NPE-in-PathfinderGoalTempt.patch
Normal file
20
Spigot-Server-Patches/Avoid-NPE-in-PathfinderGoalTempt.patch
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
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/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
|
||||||
|
@@ -0,0 +0,0 @@ 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
--
|
Loading…
Reference in New Issue
Block a user