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