    001package net.minecraft.entity.ai;
    002
    003import net.minecraft.entity.passive.EntityVillager;
    004import net.minecraft.entity.player.EntityPlayer;
    005
    006public class EntityAILookAtTradePlayer extends EntityAIWatchClosest
    007{
    008    private final EntityVillager theMerchant;
    009
    010    public EntityAILookAtTradePlayer(EntityVillager par1EntityVillager)
    011    {
    012        super(par1EntityVillager, EntityPlayer.class, 8.0F);
    013        this.theMerchant = par1EntityVillager;
    014    }
    015
    016    /**
    017     * Returns whether the EntityAIBase should begin execution.
    018     */
    019    public boolean shouldExecute()
    020    {
    021        if (this.theMerchant.isTrading())
    022        {
    023            this.closestEntity = this.theMerchant.getCustomer();
    024            return true;
    025        }
    026        else
    027        {
    028            return false;
    029        }
    030    }
    031}