mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 03:39:58 +03:00
29 lines
1.0 KiB
Diff
29 lines
1.0 KiB
Diff
--- ../src-base/minecraft/net/minecraft/entity/ai/EntityAITarget.java
|
|
+++ ../src-work/minecraft/net/minecraft/entity/ai/EntityAITarget.java
|
|
@@ -13,6 +13,7 @@
|
|
import net.minecraft.scoreboard.Team;
|
|
import net.minecraft.util.math.BlockPos;
|
|
import net.minecraft.util.math.MathHelper;
|
|
+import org.bukkit.event.entity.EntityTargetEvent;
|
|
|
|
public abstract class EntityAITarget extends EntityAIBase
|
|
{
|
|
@@ -92,7 +93,7 @@
|
|
}
|
|
else
|
|
{
|
|
- this.taskOwner.setAttackTarget(entitylivingbase);
|
|
+ this.taskOwner.setGoalTarget(entitylivingbase, EntityTargetEvent.TargetReason.CLOSEST_ENTITY, true);
|
|
return true;
|
|
}
|
|
}
|
|
@@ -115,7 +116,7 @@
|
|
|
|
public void resetTask()
|
|
{
|
|
- this.taskOwner.setAttackTarget((EntityLivingBase)null);
|
|
+ this.taskOwner.setGoalTarget((EntityLivingBase)null, EntityTargetEvent.TargetReason.FORGOT_TARGET, true);
|
|
this.target = null;
|
|
}
|
|
|