    001    package net.minecraft.entity.ai;
    002
    003    import java.util.ArrayList;
    004    import java.util.List;
    005    import net.minecraft.entity.Entity;
    006    import net.minecraft.entity.EntityLiving;
    007
    008    public class EntitySenses
    009    {
    010        EntityLiving entityObj;
    011        List field_75524_b = new ArrayList();
    012        List field_75525_c = new ArrayList();
    013
    014        public EntitySenses(EntityLiving par1EntityLiving)
    015        {
    016            this.entityObj = par1EntityLiving;
    017        }
    018
    019        /**
    020         * Clears canSeeCachePositive and canSeeCacheNegative.
    021         */
    022        public void clearSensingCache()
    023        {
    024            this.field_75524_b.clear();
    025            this.field_75525_c.clear();
    026        }
    027
    028        /**
    029         * Checks, whether 'our' entity can see the entity given as argument (true) or not (false), caching the result.
    030         */
    031        public boolean canSee(Entity par1Entity)
    032        {
    033            if (this.field_75524_b.contains(par1Entity))
    034            {
    035                return true;
    036            }
    037            else if (this.field_75525_c.contains(par1Entity))
    038            {
    039                return false;
    040            }
    041            else
    042            {
    043                this.entityObj.worldObj.theProfiler.startSection("canSee");
    044                boolean var2 = this.entityObj.canEntityBeSeen(par1Entity);
    045                this.entityObj.worldObj.theProfiler.endSection();
    046
    047                if (var2)
    048                {
    049                    this.field_75524_b.add(par1Entity);
    050                }
    051                else
    052                {
    053                    this.field_75525_c.add(par1Entity);
    054                }
    055
    056                return var2;
    057            }
    058        }
    059    }