summaryrefslogtreecommitdiffstats
path: root/nms-patches/PathfinderGoalTarget.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/PathfinderGoalTarget.patch')
-rw-r--r--nms-patches/PathfinderGoalTarget.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/nms-patches/PathfinderGoalTarget.patch b/nms-patches/PathfinderGoalTarget.patch
new file mode 100644
index 00000000..6aade4c9
--- /dev/null
+++ b/nms-patches/PathfinderGoalTarget.patch
@@ -0,0 +1,28 @@
+--- a/net/minecraft/server/PathfinderGoalTarget.java
++++ b/net/minecraft/server/PathfinderGoalTarget.java
+@@ -1,5 +1,7 @@
+ package net.minecraft.server;
+
++import org.bukkit.event.entity.EntityTargetEvent;
++
+ public abstract class PathfinderGoalTarget extends PathfinderGoal {
+
+ protected final EntityCreature e;
+@@ -56,7 +58,7 @@
+ if (entityliving instanceof EntityHuman && ((EntityHuman) entityliving).abilities.isInvulnerable) {
+ return false;
+ } else {
+- this.e.setGoalTarget(entityliving);
++ this.e.setGoalTarget(entityliving, EntityTargetEvent.TargetReason.CLOSEST_ENTITY, true); // CraftBukkit
+ return true;
+ }
+ }
+@@ -77,7 +79,7 @@
+ }
+
+ public void d() {
+- this.e.setGoalTarget((EntityLiving) null);
++ this.e.setGoalTarget((EntityLiving) null, EntityTargetEvent.TargetReason.FORGOT_TARGET, true); // CraftBukkit
+ this.g = null;
+ }
+