mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 12:46:12 +03:00
30 lines
1.2 KiB
Diff
30 lines
1.2 KiB
Diff
--- ../src-base/minecraft/net/minecraft/entity/ai/EntityAINearestAttackableTarget.java
|
|
+++ ../src-work/minecraft/net/minecraft/entity/ai/EntityAINearestAttackableTarget.java
|
|
@@ -24,7 +24,7 @@
|
|
{
|
|
protected final Class<T> targetClass;
|
|
private final int targetChance;
|
|
- protected final EntityAINearestAttackableTarget.Sorter sorter;
|
|
+ protected final Sorter sorter;
|
|
protected final Predicate <? super T > targetEntitySelector;
|
|
protected T targetEntity;
|
|
|
|
@@ -43,7 +43,7 @@
|
|
super(creature, checkSight, onlyNearby);
|
|
this.targetClass = classTarget;
|
|
this.targetChance = chance;
|
|
- this.sorter = new EntityAINearestAttackableTarget.Sorter(creature);
|
|
+ this.sorter = new Sorter(creature);
|
|
this.setMutexBits(1);
|
|
this.targetEntitySelector = new Predicate<T>()
|
|
{
|
|
@@ -122,7 +122,7 @@
|
|
|
|
public void startExecuting()
|
|
{
|
|
- this.taskOwner.setAttackTarget(this.targetEntity);
|
|
+ this.taskOwner.setGoalTarget(this.targetEntity, targetEntity instanceof EntityPlayer ? org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER : org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_ENTITY, true);
|
|
super.startExecuting();
|
|
}
|
|
|