PaperMC/nms-patches/PathfinderGoalTarget.patch

29 lines
1 KiB
Diff
Raw Normal View History

2016-02-29 22:32:46 +01:00
--- a/net/minecraft/server/PathfinderGoalTarget.java
+++ b/net/minecraft/server/PathfinderGoalTarget.java
2016-11-17 02:41:03 +01:00
@@ -1,6 +1,7 @@
2016-02-29 22:32:46 +01:00
package net.minecraft.server;
2016-11-17 02:41:03 +01:00
import javax.annotation.Nullable;
+import org.bukkit.event.entity.EntityTargetEvent; // CraftBukkit
2016-02-29 22:32:46 +01:00
public abstract class PathfinderGoalTarget extends PathfinderGoal {
2016-11-17 02:41:03 +01:00
@@ -58,7 +59,7 @@
2016-02-29 22:32:46 +01:00
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;
}
}
2016-11-17 02:41:03 +01:00
@@ -79,7 +80,7 @@
2016-02-29 22:32:46 +01:00
}
public void d() {
- this.e.setGoalTarget((EntityLiving) null);
+ this.e.setGoalTarget((EntityLiving) null, EntityTargetEvent.TargetReason.FORGOT_TARGET, true); // CraftBukkit
this.g = null;
}