3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-21 05:50:05 +01:00
Paper/nms-patches/PathfinderGoalTarget.patch
2019-04-23 12:00:00 +10:00

29 Zeilen
1.0 KiB
Diff

--- a/net/minecraft/server/PathfinderGoalTarget.java
+++ b/net/minecraft/server/PathfinderGoalTarget.java
@@ -1,6 +1,7 @@
package net.minecraft.server;
import javax.annotation.Nullable;
+import org.bukkit.event.entity.EntityTargetEvent; // CraftBukkit
public abstract class PathfinderGoalTarget extends PathfinderGoal {
@@ -59,7 +60,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;
}
}
@@ -82,7 +83,7 @@
@Override
public void d() {
- this.e.setGoalTarget((EntityLiving) null);
+ this.e.setGoalTarget((EntityLiving) null, EntityTargetEvent.TargetReason.FORGOT_TARGET, true); // CraftBukkit
this.g = null;
}