You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			61 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Java
		
	
			
		
		
	
	
			61 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Java
		
	
package net.minecraft.entity.ai;
 | 
						|
 | 
						|
import net.minecraft.entity.EntityLivingBase;
 | 
						|
import net.minecraft.entity.passive.EntityTameable;
 | 
						|
 | 
						|
public class EntityAIOwnerHurtTarget extends EntityAITarget
 | 
						|
{
 | 
						|
    EntityTameable theEntityTameable;
 | 
						|
    EntityLivingBase theTarget;
 | 
						|
    private int field_142050_e;
 | 
						|
    private static final String __OBFID = "CL_00001625";
 | 
						|
 | 
						|
    public EntityAIOwnerHurtTarget(EntityTameable p_i1668_1_)
 | 
						|
    {
 | 
						|
        super(p_i1668_1_, false);
 | 
						|
        this.theEntityTameable = p_i1668_1_;
 | 
						|
        this.setMutexBits(1);
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * Returns whether the EntityAIBase should begin execution.
 | 
						|
     */
 | 
						|
    public boolean shouldExecute()
 | 
						|
    {
 | 
						|
        if (!this.theEntityTameable.isTamed())
 | 
						|
        {
 | 
						|
            return false;
 | 
						|
        }
 | 
						|
        else
 | 
						|
        {
 | 
						|
            EntityLivingBase entitylivingbase = this.theEntityTameable.getOwner();
 | 
						|
 | 
						|
            if (entitylivingbase == null)
 | 
						|
            {
 | 
						|
                return false;
 | 
						|
            }
 | 
						|
            else
 | 
						|
            {
 | 
						|
                this.theTarget = entitylivingbase.getLastAttacker();
 | 
						|
                int i = entitylivingbase.getLastAttackerTime();
 | 
						|
                return i != this.field_142050_e && this.isSuitableTarget(this.theTarget, false) && this.theEntityTameable.func_142018_a(this.theTarget, entitylivingbase);
 | 
						|
            }
 | 
						|
        }
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * Execute a one shot task or start executing a continuous task
 | 
						|
     */
 | 
						|
    public void startExecuting()
 | 
						|
    {
 | 
						|
        this.taskOwner.setAttackTarget(this.theTarget);
 | 
						|
        EntityLivingBase entitylivingbase = this.theEntityTameable.getOwner();
 | 
						|
 | 
						|
        if (entitylivingbase != null)
 | 
						|
        {
 | 
						|
            this.field_142050_e = entitylivingbase.getLastAttackerTime();
 | 
						|
        }
 | 
						|
 | 
						|
        super.startExecuting();
 | 
						|
    }
 | 
						|
} |