Java Code Examples for net.minecraft.command.IEntitySelector

The following are top voted examples for showing how to use net.minecraft.command.IEntitySelector. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: NyaSamaRailway   File: RailMonoMagnetDetector.java   Source Code and License 6 votes vote down vote up
@Override
public int getComparatorInputOverride(World world, int x, int y, int z, int i)
{
    if ((world.getBlockMetadata(x, y, z) & 8) > 0)
    {
        float f = 0.125F;
        List list = world.getEntitiesWithinAABB(EntityMinecartCommandBlock.class, AxisAlignedBB.getBoundingBox((double)((float)x + f), (double)y, (double)((float)z + f), (double)((float)(x + 1) - f), (double)((float)(y + 1) - f), (double)((float)(z + 1) - f)));

        if (list.size() > 0)
        {
            return ((EntityMinecartCommandBlock)list.get(0)).func_145822_e().func_145760_g();
        }

        List list1 = world.selectEntitiesWithinAABB(EntityMinecart.class, AxisAlignedBB.getBoundingBox((double)((float)x + f), (double)y, (double)((float)z + f), (double)((float)(x + 1) - f), (double)((float)(y + 1) - f), (double)((float)(z + 1) - f)), IEntitySelector.selectInventories);

        if (list1.size() > 0)
        {
            return Container.calcRedstoneFromInventory((IInventory)list1.get(0));
        }
    }

    return 0;
}
 
Example 2
Project: Coding   File: EntityAINearestAttackableDragon.java   Source Code and License 6 votes vote down vote up
public EntityAINearestAttackableDragon(EntityCreature attacker, int p_i1665_3_, boolean p_i1665_4_, boolean p_i1665_5_, final IEntitySelector p_i1665_6_) {
        super(attacker, p_i1665_4_, p_i1665_5_);
        this.targetClass = EntityPlayer.class;
        this.targetChance = p_i1665_3_;
        this.theNearestAttackableTargetSorter = new EntityAINearestAttackableTarget.Sorter(attacker);
        this.setMutexBits(1);
        this.targetEntitySelector = new IEntitySelector() {
//            private static final String __OBFID = "CL_00001621";
            /**
             * Return whether the specified entity is applicable to this filter.
             */
            public boolean isEntityApplicable(Entity p_82704_1_) {
                return !(p_82704_1_ instanceof EntityLivingBase) ? false : 
                	(p_i1665_6_ != null && !p_i1665_6_.isEntityApplicable(p_82704_1_) ? false : 
                		EntityAINearestAttackableDragon.this.isSuitableTarget((EntityLivingBase)p_82704_1_, false));
            }
        };
    }
 
Example 3
Project: Coding   File: EntityBaron.java   Source Code and License 6 votes vote down vote up
public EntityBaron(World world){
	super(world);
	// TODO: Add a new AI that summons 2 guards if no guards are nearby
	this.tasks.addTask(1, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, true));
	this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityCreature.class, 0, true, false, 
			new IEntitySelector() {
				public boolean isEntityApplicable(Entity entity) {
					if (!isLookingForHome && ((EntityCreature) entity).isWithinHomeDistanceCurrentPosition() && entity instanceof EntityZombie)
						return true;
					return false;
				}
		}));		
	// Summons 2 guards
	this.targetTasks.addTask(3, new EntityAISummonGuards(this, EntityPlayer.class, true, true, 2));

	setGuardWeaponType(type);
}
 
Example 4
Project: Coding   File: EntitySpearGuard.java   Source Code and License 6 votes vote down vote up
public EntitySpearGuard(World world){
	super(world);
	if (this.worldObj.difficultySetting == EnumDifficulty.EASY)
		this.tasks.addTask(1, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, true));
	else
		this.tasks.addTask(1, new EntityAISpearAttack(this, 1.0D, 20, 60, 15.0F));
	this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityCreature.class, 0, true, false, 
			new IEntitySelector() {
				public boolean isEntityApplicable(Entity entity) {
					if (!isLookingForHome && ((EntityCreature) entity).isWithinHomeDistanceCurrentPosition() && entity instanceof EntityZombie)
						return true;
					return false;
				}
		}));		        
	setGuardWeaponType(type);
}
 
Example 5
Project: Coding   File: EntityLongbowGuard.java   Source Code and License 6 votes vote down vote up
public EntityLongbowGuard(World world){
	super(world);
	if (this.worldObj.difficultySetting == EnumDifficulty.EASY)
		this.tasks.addTask(1, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, true));
	else
		this.tasks.addTask(1, new EntityAIArrowAttack(this, 1.0D, 20, 60, 15.0F));
	this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityCreature.class, 0, true, false, 
			new IEntitySelector() {
				public boolean isEntityApplicable(Entity entity) {
					if (!isLookingForHome && ((EntityCreature) entity).isWithinHomeDistanceCurrentPosition() && entity instanceof EntityZombie)
						return true;
					return false;
				}
		}));		        
	setGuardWeaponType(type);
}
 
Example 6
Project: Coding   File: EntityCrossbowGuard.java   Source Code and License 6 votes vote down vote up
public EntityCrossbowGuard(World world){
	super(world);
	if (this.worldObj.difficultySetting == EnumDifficulty.EASY)
		this.tasks.addTask(1, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, true));
	else
		this.tasks.addTask(1, new EntityAIArrowAttack(this, 1.0D, 20, 60, 15.0F));
	this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityCreature.class, 0, true, false, 
			new IEntitySelector() {
				public boolean isEntityApplicable(Entity entity) {
					if (!isLookingForHome && ((EntityCreature) entity).isWithinHomeDistanceCurrentPosition() && entity instanceof EntityZombie)
						return true;
					return false;
				}
		}));		        
	setGuardWeaponType(type);
}
 
Example 7
Project: FutureCraft   File: TileEntityMovingSidewalk.java   Source Code and License 6 votes vote down vote up
@Override
public void update() {
	
	if (!worldObj.isRemote) {

		List<?> list = worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(this.pos.getX(), this.pos.getY() + 1.0D, this.pos.getZ(), this.pos.getX() + 1.0D, this.pos.getY() + 1.1D, this.pos.getZ() + 1.0D), IEntitySelector.selectAnything);
		
		for (int i = 0; i < list.size(); i++) {
			
			if (list.get(i) instanceof Entity || list.get(i) instanceof EntityPlayer) {
				Entity entity = null;
				if (list.get(i) instanceof Entity) entity = (Entity) list.get(i);
				else if (list.get(i) instanceof EntityPlayer) entity = (EntityPlayer) list.get(i);
				if (worldObj.getBlockState(this.getPos()) == BlockList.moving_sidewalk.getStateFromMeta(0)) entity.addVelocity(0, 0, 0.1);
				if (worldObj.getBlockState(this.getPos()) == BlockList.moving_sidewalk.getStateFromMeta(1)) entity.addVelocity(-0.1, 0, 0);
				if (worldObj.getBlockState(this.getPos()) == BlockList.moving_sidewalk.getStateFromMeta(2)) entity.addVelocity(0, 0, -0.1);
				if (worldObj.getBlockState(this.getPos()) == BlockList.moving_sidewalk.getStateFromMeta(3)) entity.addVelocity(0.1, 0, 0);
					 }
		}
	}
	
}
 
Example 8
Project: Resilience-Client-Source   File: Chunk.java   Source Code and License 6 votes vote down vote up
/**
 * Gets all entities that can be assigned to the specified class. Args: entityClass, aabb, listToFill
 */
public void getEntitiesOfTypeWithinAAAB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, List par3List, IEntitySelector par4IEntitySelector)
{
    int var5 = MathHelper.floor_double((par2AxisAlignedBB.minY - 2.0D) / 16.0D);
    int var6 = MathHelper.floor_double((par2AxisAlignedBB.maxY + 2.0D) / 16.0D);
    var5 = MathHelper.clamp_int(var5, 0, this.entityLists.length - 1);
    var6 = MathHelper.clamp_int(var6, 0, this.entityLists.length - 1);

    for (int var7 = var5; var7 <= var6; ++var7)
    {
        List var8 = this.entityLists[var7];

        for (int var9 = 0; var9 < var8.size(); ++var9)
        {
            Entity var10 = (Entity)var8.get(var9);

            if (par1Class.isAssignableFrom(var10.getClass()) && var10.boundingBox.intersectsWith(par2AxisAlignedBB) && (par4IEntitySelector == null || par4IEntitySelector.isEntityApplicable(var10)))
            {
                par3List.add(var10);
            }
        }
    }
}
 
Example 9
Project: Resilience-Client-Source   File: World.java   Source Code and License 6 votes vote down vote up
public List getEntitiesWithinAABBExcludingEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector)
{
    ArrayList var4 = new ArrayList();
    int var5 = MathHelper.floor_double((par2AxisAlignedBB.minX - 2.0D) / 16.0D);
    int var6 = MathHelper.floor_double((par2AxisAlignedBB.maxX + 2.0D) / 16.0D);
    int var7 = MathHelper.floor_double((par2AxisAlignedBB.minZ - 2.0D) / 16.0D);
    int var8 = MathHelper.floor_double((par2AxisAlignedBB.maxZ + 2.0D) / 16.0D);

    for (int var9 = var5; var9 <= var6; ++var9)
    {
        for (int var10 = var7; var10 <= var8; ++var10)
        {
            if (this.chunkExists(var9, var10))
            {
                this.getChunkFromChunkCoords(var9, var10).getEntitiesWithinAABBForEntity(par1Entity, par2AxisAlignedBB, var4, par3IEntitySelector);
            }
        }
    }

    return var4;
}
 
Example 10
Project: Resilience-Client-Source   File: World.java   Source Code and License 6 votes vote down vote up
public List selectEntitiesWithinAABB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector)
{
    int var4 = MathHelper.floor_double((par2AxisAlignedBB.minX - 2.0D) / 16.0D);
    int var5 = MathHelper.floor_double((par2AxisAlignedBB.maxX + 2.0D) / 16.0D);
    int var6 = MathHelper.floor_double((par2AxisAlignedBB.minZ - 2.0D) / 16.0D);
    int var7 = MathHelper.floor_double((par2AxisAlignedBB.maxZ + 2.0D) / 16.0D);
    ArrayList var8 = new ArrayList();

    for (int var9 = var4; var9 <= var5; ++var9)
    {
        for (int var10 = var6; var10 <= var7; ++var10)
        {
            if (this.chunkExists(var9, var10))
            {
                this.getChunkFromChunkCoords(var9, var10).getEntitiesOfTypeWithinAAAB(par1Class, par2AxisAlignedBB, var8, par3IEntitySelector);
            }
        }
    }

    return var8;
}
 
Example 11
Project: Resilience-Client-Source   File: EntityAINearestAttackableTarget.java   Source Code and License 6 votes vote down vote up
public EntityAINearestAttackableTarget(EntityCreature par1EntityCreature, Class par2Class, int par3, boolean par4, boolean par5, final IEntitySelector par6IEntitySelector)
{
    super(par1EntityCreature, par4, par5);
    this.targetClass = par2Class;
    this.targetChance = par3;
    this.theNearestAttackableTargetSorter = new EntityAINearestAttackableTarget.Sorter(par1EntityCreature);
    this.setMutexBits(1);
    this.targetEntitySelector = new IEntitySelector()
    {
        private static final String __OBFID = "CL_00001621";
        public boolean isEntityApplicable(Entity par1Entity)
        {
            return !(par1Entity instanceof EntityLivingBase) ? false : (par6IEntitySelector != null && !par6IEntitySelector.isEntityApplicable(par1Entity) ? false : EntityAINearestAttackableTarget.this.isSuitableTarget((EntityLivingBase)par1Entity, false));
        }
    };
}
 
Example 12
Project: Resilience-Client-Source   File: EntityMinecartHopper.java   Source Code and License 6 votes vote down vote up
public boolean func_96112_aD()
{
    if (TileEntityHopper.func_145891_a(this))
    {
        return true;
    }
    else
    {
        List var1 = this.worldObj.selectEntitiesWithinAABB(EntityItem.class, this.boundingBox.expand(0.25D, 0.0D, 0.25D), IEntitySelector.selectAnything);

        if (var1.size() > 0)
        {
            TileEntityHopper.func_145898_a(this, (EntityItem)var1.get(0));
        }

        return false;
    }
}
 
Example 13
Project: Resilience-Client-Source   File: BlockRailDetector.java   Source Code and License 6 votes vote down vote up
public int getComparatorInputOverride(World p_149736_1_, int p_149736_2_, int p_149736_3_, int p_149736_4_, int p_149736_5_)
{
    if ((p_149736_1_.getBlockMetadata(p_149736_2_, p_149736_3_, p_149736_4_) & 8) > 0)
    {
        float var6 = 0.125F;
        List var7 = p_149736_1_.getEntitiesWithinAABB(EntityMinecartCommandBlock.class, AxisAlignedBB.getAABBPool().getAABB((double)((float)p_149736_2_ + var6), (double)p_149736_3_, (double)((float)p_149736_4_ + var6), (double)((float)(p_149736_2_ + 1) - var6), (double)((float)(p_149736_3_ + 1) - var6), (double)((float)(p_149736_4_ + 1) - var6)));

        if (var7.size() > 0)
        {
            return ((EntityMinecartCommandBlock)var7.get(0)).func_145822_e().func_145760_g();
        }

        List var8 = p_149736_1_.selectEntitiesWithinAABB(EntityMinecart.class, AxisAlignedBB.getAABBPool().getAABB((double)((float)p_149736_2_ + var6), (double)p_149736_3_, (double)((float)p_149736_4_ + var6), (double)((float)(p_149736_2_ + 1) - var6), (double)((float)(p_149736_3_ + 1) - var6), (double)((float)(p_149736_4_ + 1) - var6)), IEntitySelector.selectInventories);

        if (var8.size() > 0)
        {
            return Container.calcRedstoneFromInventory((IInventory)var8.get(0));
        }
    }

    return 0;
}
 
Example 14
Project: hungryZombies   File: EntityAICustomNearestAttackableTarget.java   Source Code and License 6 votes vote down vote up
public EntityAICustomNearestAttackableTarget(EntityCreature p_i1665_1_, Class p_i1665_2_, int p_i1665_3_, boolean p_i1665_4_, boolean p_i1665_5_, final IEntitySelector p_i1665_6_)
{
    super(p_i1665_1_, p_i1665_4_, p_i1665_5_);
    this.targetClass = p_i1665_2_;
    this.targetChance = p_i1665_3_;
    this.theNearestAttackableTargetSorter = new EntityAICustomNearestAttackableTarget.Sorter(p_i1665_1_);
    this.setMutexBits(1);
    this.targetEntitySelector = new IEntitySelector()
    {
        private static final String __OBFID = "CL_00001621";
        /**
         * Return whether the specified entity is applicable to this filter.
         */
        public boolean isEntityApplicable(Entity p_82704_1_)
        {
            return !(p_82704_1_ instanceof EntityLivingBase) ? false : (p_i1665_6_ != null && !p_i1665_6_.isEntityApplicable(p_82704_1_) ? false : EntityAICustomNearestAttackableTarget.this.isSuitableTarget((EntityLivingBase)p_82704_1_, false));
        }
    };
}
 
Example 15
Project: Magicians-Artifice   File: EntityHelper.java   Source Code and License 6 votes vote down vote up
public static Entity getClosestEntity(World world, int x, int y, int z, int range, EntityPlayer player) {
    // unfortunately the method returns a list without a generic type, so we have to treat the elements of the list as objects. thats why i didn't do List<Entity>, its not my fault
    List entities = world.getEntitiesWithinAABBExcludingEntity(player, AxisAlignedBB.getBoundingBox(x - range, y - range, z - range, x + range, y + range, z + range), IEntitySelector.selectAnything);

    Entity closest = null;
    double dist = -1;
    for(Object o : entities) {
        System.out.println(o);
        Entity e = (Entity) o;

        double d = Math.sqrt((x - e.posX) + (x - e.posY) + (z + e.posZ));
        if(dist == -1 && d < dist) {
            dist = d;
            closest = e;
        }
    }

    //System.out.println(closest);
    return closest;
}
 
Example 16
Project: vintagecraft   File: EntityAIStayCloseToGroup.java   Source Code and License 6 votes vote down vote up
public Entity findNearestEntityWithinAABB(Class entityType, AxisAlignedBB aabb, Entity closestTo, int excludingEntityId) {
    List list = entity.worldObj.getEntitiesWithinAABB(entityType, aabb);
    Entity closestEntity = null;
    double smallestDistance = Double.MAX_VALUE;

    for (int i = 0; i < list.size(); ++i) {
        Entity entity2 = (Entity)list.get(i);

        if (entity2 != closestTo && IEntitySelector.NOT_SPECTATING.apply(entity2)) {
            double dist = closestTo.getDistanceSqToEntity(entity2);

            if (dist <= smallestDistance && excludingEntityId != entity2.getEntityId()) {
                closestEntity = entity2;
                smallestDistance = dist;
            }
        }
    }

    return closestEntity;
}
 
Example 17
Project: Cauldron   File: Chunk.java   Source Code and License 6 votes vote down vote up
public void getEntitiesOfTypeWithinAAAB(Class p_76618_1_, AxisAlignedBB p_76618_2_, List p_76618_3_, IEntitySelector p_76618_4_)
{
    int i = MathHelper.floor_double((p_76618_2_.minY - World.MAX_ENTITY_RADIUS) / 16.0D);
    int j = MathHelper.floor_double((p_76618_2_.maxY + World.MAX_ENTITY_RADIUS) / 16.0D);
    i = MathHelper.clamp_int(i, 0, this.entityLists.length - 1);
    j = MathHelper.clamp_int(j, 0, this.entityLists.length - 1);

    for (int k = i; k <= j; ++k)
    {
        List list1 = this.entityLists[k];

        for (int l = 0; l < list1.size(); ++l)
        {
            Entity entity = (Entity)list1.get(l);

            if (p_76618_1_.isAssignableFrom(entity.getClass()) && entity.boundingBox.intersectsWith(p_76618_2_) && (p_76618_4_ == null || p_76618_4_.isEntityApplicable(entity)))
            {
                p_76618_3_.add(entity);
            }
        }
    }
}
 
Example 18
Project: Cauldron   File: World.java   Source Code and License 6 votes vote down vote up
public List getEntitiesWithinAABBExcludingEntity(Entity p_94576_1_, AxisAlignedBB p_94576_2_, IEntitySelector p_94576_3_)
{
    ArrayList arraylist = new ArrayList();
    int i = MathHelper.floor_double((p_94576_2_.minX - MAX_ENTITY_RADIUS) / 16.0D);
    int j = MathHelper.floor_double((p_94576_2_.maxX + MAX_ENTITY_RADIUS) / 16.0D);
    int k = MathHelper.floor_double((p_94576_2_.minZ - MAX_ENTITY_RADIUS) / 16.0D);
    int l = MathHelper.floor_double((p_94576_2_.maxZ + MAX_ENTITY_RADIUS) / 16.0D);

    for (int i1 = i; i1 <= j; ++i1)
    {
        for (int j1 = k; j1 <= l; ++j1)
        {
            if (this.chunkExists(i1, j1))
            {
                this.getChunkFromChunkCoords(i1, j1).getEntitiesWithinAABBForEntity(p_94576_1_, p_94576_2_, arraylist, p_94576_3_);
            }
        }
    }

    return arraylist;
}
 
Example 19
Project: Cauldron   File: World.java   Source Code and License 6 votes vote down vote up
public List selectEntitiesWithinAABB(Class p_82733_1_, AxisAlignedBB p_82733_2_, IEntitySelector p_82733_3_)
{
    int i = MathHelper.floor_double((p_82733_2_.minX - MAX_ENTITY_RADIUS) / 16.0D);
    int j = MathHelper.floor_double((p_82733_2_.maxX + MAX_ENTITY_RADIUS) / 16.0D);
    int k = MathHelper.floor_double((p_82733_2_.minZ - MAX_ENTITY_RADIUS) / 16.0D);
    int l = MathHelper.floor_double((p_82733_2_.maxZ + MAX_ENTITY_RADIUS) / 16.0D);
    ArrayList arraylist = new ArrayList();

    for (int i1 = i; i1 <= j; ++i1)
    {
        for (int j1 = k; j1 <= l; ++j1)
        {
            if (this.chunkExists(i1, j1))
            {
                this.getChunkFromChunkCoords(i1, j1).getEntitiesOfTypeWithinAAAB(p_82733_1_, p_82733_2_, arraylist, p_82733_3_);
            }
        }
    }

    return arraylist;
}
 
Example 20
Project: Cauldron   File: EntityAINearestAttackableTarget.java   Source Code and License 6 votes vote down vote up
public EntityAINearestAttackableTarget(EntityCreature p_i1665_1_, Class p_i1665_2_, int p_i1665_3_, boolean p_i1665_4_, boolean p_i1665_5_, final IEntitySelector p_i1665_6_)
{
    super(p_i1665_1_, p_i1665_4_, p_i1665_5_);
    this.targetClass = p_i1665_2_;
    this.targetChance = p_i1665_3_;
    this.theNearestAttackableTargetSorter = new EntityAINearestAttackableTarget.Sorter(p_i1665_1_);
    this.setMutexBits(1);
    this.targetEntitySelector = new IEntitySelector()
    {
        private static final String __OBFID = "CL_00001621";
        public boolean isEntityApplicable(Entity p_82704_1_)
        {
            return !(p_82704_1_ instanceof EntityLivingBase) ? false : (p_i1665_6_ != null && !p_i1665_6_.isEntityApplicable(p_82704_1_) ? false : EntityAINearestAttackableTarget.this.isSuitableTarget((EntityLivingBase)p_82704_1_, false));
        }
    };
}
 
Example 21
Project: Cauldron   File: EntityMinecartHopper.java   Source Code and License 6 votes vote down vote up
public boolean func_96112_aD()
{
    if (TileEntityHopper.func_145891_a(this))
    {
        return true;
    }
    else
    {
        List list = this.worldObj.selectEntitiesWithinAABB(EntityItem.class, this.boundingBox.expand(0.25D, 0.0D, 0.25D), IEntitySelector.selectAnything);

        if (list.size() > 0)
        {
            TileEntityHopper.func_145898_a(this, (EntityItem)list.get(0));
        }

        return false;
    }
}
 
Example 22
Project: Cauldron   File: BlockRailDetector.java   Source Code and License 6 votes vote down vote up
public int getComparatorInputOverride(World p_149736_1_, int p_149736_2_, int p_149736_3_, int p_149736_4_, int p_149736_5_)
{
    if ((p_149736_1_.getBlockMetadata(p_149736_2_, p_149736_3_, p_149736_4_) & 8) > 0)
    {
        float f = 0.125F;
        List list = p_149736_1_.getEntitiesWithinAABB(EntityMinecartCommandBlock.class, AxisAlignedBB.getBoundingBox((double)((float)p_149736_2_ + f), (double)p_149736_3_, (double)((float)p_149736_4_ + f), (double)((float)(p_149736_2_ + 1) - f), (double)((float)(p_149736_3_ + 1) - f), (double)((float)(p_149736_4_ + 1) - f)));

        if (list.size() > 0)
        {
            return ((EntityMinecartCommandBlock)list.get(0)).func_145822_e().func_145760_g();
        }

        List list1 = p_149736_1_.selectEntitiesWithinAABB(EntityMinecart.class, AxisAlignedBB.getBoundingBox((double)((float)p_149736_2_ + f), (double)p_149736_3_, (double)((float)p_149736_4_ + f), (double)((float)(p_149736_2_ + 1) - f), (double)((float)(p_149736_3_ + 1) - f), (double)((float)(p_149736_4_ + 1) - f)), IEntitySelector.selectInventories);

        if (list1.size() > 0)
        {
            return Container.calcRedstoneFromInventory((IInventory)list1.get(0));
        }
    }

    return 0;
}
 
Example 23
Project: Cauldron   File: Chunk.java   Source Code and License 6 votes vote down vote up
public void getEntitiesOfTypeWithinAAAB(Class p_76618_1_, AxisAlignedBB p_76618_2_, List p_76618_3_, IEntitySelector p_76618_4_)
{
    int i = MathHelper.floor_double((p_76618_2_.minY - World.MAX_ENTITY_RADIUS) / 16.0D);
    int j = MathHelper.floor_double((p_76618_2_.maxY + World.MAX_ENTITY_RADIUS) / 16.0D);
    i = MathHelper.clamp_int(i, 0, this.entityLists.length - 1);
    j = MathHelper.clamp_int(j, 0, this.entityLists.length - 1);

    for (int k = i; k <= j; ++k)
    {
        List list1 = this.entityLists[k];

        for (int l = 0; l < list1.size(); ++l)
        {
            Entity entity = (Entity)list1.get(l);

            if (p_76618_1_.isAssignableFrom(entity.getClass()) && entity.boundingBox.intersectsWith(p_76618_2_) && (p_76618_4_ == null || p_76618_4_.isEntityApplicable(entity)))
            {
                p_76618_3_.add(entity);
            }
        }
    }
}
 
Example 24
Project: Cauldron   File: World.java   Source Code and License 6 votes vote down vote up
public List getEntitiesWithinAABBExcludingEntity(Entity p_94576_1_, AxisAlignedBB p_94576_2_, IEntitySelector p_94576_3_)
{
    ArrayList arraylist = new ArrayList();
    int i = MathHelper.floor_double((p_94576_2_.minX - MAX_ENTITY_RADIUS) / 16.0D);
    int j = MathHelper.floor_double((p_94576_2_.maxX + MAX_ENTITY_RADIUS) / 16.0D);
    int k = MathHelper.floor_double((p_94576_2_.minZ - MAX_ENTITY_RADIUS) / 16.0D);
    int l = MathHelper.floor_double((p_94576_2_.maxZ + MAX_ENTITY_RADIUS) / 16.0D);

    for (int i1 = i; i1 <= j; ++i1)
    {
        for (int j1 = k; j1 <= l; ++j1)
        {
            if (this.chunkExists(i1, j1))
            {
                this.getChunkFromChunkCoords(i1, j1).getEntitiesWithinAABBForEntity(p_94576_1_, p_94576_2_, arraylist, p_94576_3_);
            }
        }
    }

    return arraylist;
}
 
Example 25
Project: Cauldron   File: World.java   Source Code and License 6 votes vote down vote up
public List selectEntitiesWithinAABB(Class p_82733_1_, AxisAlignedBB p_82733_2_, IEntitySelector p_82733_3_)
{
    int i = MathHelper.floor_double((p_82733_2_.minX - MAX_ENTITY_RADIUS) / 16.0D);
    int j = MathHelper.floor_double((p_82733_2_.maxX + MAX_ENTITY_RADIUS) / 16.0D);
    int k = MathHelper.floor_double((p_82733_2_.minZ - MAX_ENTITY_RADIUS) / 16.0D);
    int l = MathHelper.floor_double((p_82733_2_.maxZ + MAX_ENTITY_RADIUS) / 16.0D);
    ArrayList arraylist = new ArrayList();

    for (int i1 = i; i1 <= j; ++i1)
    {
        for (int j1 = k; j1 <= l; ++j1)
        {
            if (this.chunkExists(i1, j1))
            {
                this.getChunkFromChunkCoords(i1, j1).getEntitiesOfTypeWithinAAAB(p_82733_1_, p_82733_2_, arraylist, p_82733_3_);
            }
        }
    }

    return arraylist;
}
 
Example 26
Project: Cauldron   File: EntityAINearestAttackableTarget.java   Source Code and License 6 votes vote down vote up
public EntityAINearestAttackableTarget(EntityCreature p_i1665_1_, Class p_i1665_2_, int p_i1665_3_, boolean p_i1665_4_, boolean p_i1665_5_, final IEntitySelector p_i1665_6_)
{
    super(p_i1665_1_, p_i1665_4_, p_i1665_5_);
    this.targetClass = p_i1665_2_;
    this.targetChance = p_i1665_3_;
    this.theNearestAttackableTargetSorter = new EntityAINearestAttackableTarget.Sorter(p_i1665_1_);
    this.setMutexBits(1);
    this.targetEntitySelector = new IEntitySelector()
    {
        private static final String __OBFID = "CL_00001621";
        public boolean isEntityApplicable(Entity p_82704_1_)
        {
            return !(p_82704_1_ instanceof EntityLivingBase) ? false : (p_i1665_6_ != null && !p_i1665_6_.isEntityApplicable(p_82704_1_) ? false : EntityAINearestAttackableTarget.this.isSuitableTarget((EntityLivingBase)p_82704_1_, false));
        }
    };
}
 
Example 27
Project: Cauldron   File: EntityMinecartHopper.java   Source Code and License 6 votes vote down vote up
public boolean func_96112_aD()
{
    if (TileEntityHopper.func_145891_a(this))
    {
        return true;
    }
    else
    {
        List list = this.worldObj.selectEntitiesWithinAABB(EntityItem.class, this.boundingBox.expand(0.25D, 0.0D, 0.25D), IEntitySelector.selectAnything);

        if (list.size() > 0)
        {
            TileEntityHopper.func_145898_a(this, (EntityItem)list.get(0));
        }

        return false;
    }
}
 
Example 28
Project: Cauldron   File: BlockRailDetector.java   Source Code and License 6 votes vote down vote up
public int getComparatorInputOverride(World p_149736_1_, int p_149736_2_, int p_149736_3_, int p_149736_4_, int p_149736_5_)
{
    if ((p_149736_1_.getBlockMetadata(p_149736_2_, p_149736_3_, p_149736_4_) & 8) > 0)
    {
        float f = 0.125F;
        List list = p_149736_1_.getEntitiesWithinAABB(EntityMinecartCommandBlock.class, AxisAlignedBB.getBoundingBox((double)((float)p_149736_2_ + f), (double)p_149736_3_, (double)((float)p_149736_4_ + f), (double)((float)(p_149736_2_ + 1) - f), (double)((float)(p_149736_3_ + 1) - f), (double)((float)(p_149736_4_ + 1) - f)));

        if (list.size() > 0)
        {
            return ((EntityMinecartCommandBlock)list.get(0)).func_145822_e().func_145760_g();
        }

        List list1 = p_149736_1_.selectEntitiesWithinAABB(EntityMinecart.class, AxisAlignedBB.getBoundingBox((double)((float)p_149736_2_ + f), (double)p_149736_3_, (double)((float)p_149736_4_ + f), (double)((float)(p_149736_2_ + 1) - f), (double)((float)(p_149736_3_ + 1) - f), (double)((float)(p_149736_4_ + 1) - f)), IEntitySelector.selectInventories);

        if (list1.size() > 0)
        {
            return Container.calcRedstoneFromInventory((IInventory)list1.get(0));
        }
    }

    return 0;
}
 
Example 29
Project: TameHumans   File: EntityAITamedNearestAttackableTarget.java   Source Code and License 6 votes vote down vote up
public EntityAITamedNearestAttackableTarget(EntityTameable p_i1665_1_, Class p_i1665_2_, int p_i1665_3_, boolean p_i1665_4_, boolean p_i1665_5_, final IEntitySelector p_i1665_6_) {
    super(p_i1665_1_, p_i1665_4_, p_i1665_5_);
    this.tameable = p_i1665_1_;
    this.targetClass = p_i1665_2_;
    this.targetChance = p_i1665_3_;
    this.theNearestAttackableTargetSorter = new EntityAITamedNearestAttackableTarget.Sorter(p_i1665_1_);
    this.setMutexBits(1);
    this.targetEntitySelector = new IEntitySelector() {
        private static final String __OBFID = "CL_00001621";

        /**
         * Return whether the specified entity is applicable to this filter.
         */
        public boolean isEntityApplicable(Entity p_82704_1_) {
            return p_82704_1_ instanceof EntityLivingBase && (p_i1665_6_ != null && !p_i1665_6_.isEntityApplicable(p_82704_1_) ? false : EntityAITamedNearestAttackableTarget.this.isSuitableTarget((EntityLivingBase) p_82704_1_, false));
        }
    };
}
 
Example 30
Project: RuneCraftery   File: World.java   Source Code and License 6 votes vote down vote up
public List func_94576_a(Entity p_94576_1_, AxisAlignedBB p_94576_2_, IEntitySelector p_94576_3_) {
   ArrayList var4 = new ArrayList();
   int var5 = MathHelper.func_76128_c((p_94576_2_.field_72340_a - 2.0D) / 16.0D);
   int var6 = MathHelper.func_76128_c((p_94576_2_.field_72336_d + 2.0D) / 16.0D);
   int var7 = MathHelper.func_76128_c((p_94576_2_.field_72339_c - 2.0D) / 16.0D);
   int var8 = MathHelper.func_76128_c((p_94576_2_.field_72334_f + 2.0D) / 16.0D);

   for(int var9 = var5; var9 <= var6; ++var9) {
      for(int var10 = var7; var10 <= var8; ++var10) {
         if(this.func_72916_c(var9, var10)) {
            this.func_72964_e(var9, var10).func_76588_a(p_94576_1_, p_94576_2_, var4, p_94576_3_);
         }
      }
   }

   return var4;
}
 
Example 31
Project: RuneCraftery   File: World.java   Source Code and License 6 votes vote down vote up
public List func_82733_a(Class p_82733_1_, AxisAlignedBB p_82733_2_, IEntitySelector p_82733_3_) {
   int var4 = MathHelper.func_76128_c((p_82733_2_.field_72340_a - 2.0D) / 16.0D);
   int var5 = MathHelper.func_76128_c((p_82733_2_.field_72336_d + 2.0D) / 16.0D);
   int var6 = MathHelper.func_76128_c((p_82733_2_.field_72339_c - 2.0D) / 16.0D);
   int var7 = MathHelper.func_76128_c((p_82733_2_.field_72334_f + 2.0D) / 16.0D);
   ArrayList var8 = new ArrayList();

   for(int var9 = var4; var9 <= var5; ++var9) {
      for(int var10 = var6; var10 <= var7; ++var10) {
         if(this.func_72916_c(var9, var10)) {
            this.func_72964_e(var9, var10).func_76618_a(p_82733_1_, p_82733_2_, var8, p_82733_3_);
         }
      }
   }

   return var8;
}
 
Example 32
Project: RuneCraftery   File: TileEntityHopper.java   Source Code and License 6 votes vote down vote up
public static IInventory func_96117_b(World p_96117_0_, double p_96117_1_, double p_96117_3_, double p_96117_5_) {
   IInventory var7 = null;
   int var8 = MathHelper.func_76128_c(p_96117_1_);
   int var9 = MathHelper.func_76128_c(p_96117_3_);
   int var10 = MathHelper.func_76128_c(p_96117_5_);
   TileEntity var11 = p_96117_0_.func_72796_p(var8, var9, var10);
   if(var11 != null && var11 instanceof IInventory) {
      var7 = (IInventory)var11;
      if(var7 instanceof TileEntityChest) {
         int var12 = p_96117_0_.func_72798_a(var8, var9, var10);
         Block var13 = Block.field_71973_m[var12];
         if(var13 instanceof BlockChest) {
            var7 = ((BlockChest)var13).func_94442_h_(p_96117_0_, var8, var9, var10);
         }
      }
   }

   if(var7 == null) {
      List var14 = p_96117_0_.func_94576_a((Entity)null, AxisAlignedBB.func_72332_a().func_72299_a(p_96117_1_, p_96117_3_, p_96117_5_, p_96117_1_ + 1.0D, p_96117_3_ + 1.0D, p_96117_5_ + 1.0D), IEntitySelector.field_96566_b);
      if(var14 != null && var14.size() > 0) {
         var7 = (IInventory)var14.get(p_96117_0_.field_73012_v.nextInt(var14.size()));
      }
   }

   return var7;
}
 
Example 33
Project: RuneCraftery   File: World.java   Source Code and License 6 votes vote down vote up
public List getEntitiesWithinAABBExcludingEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector)
{
    ArrayList arraylist = new ArrayList();
    int i = MathHelper.floor_double((par2AxisAlignedBB.minX - MAX_ENTITY_RADIUS) / 16.0D);
    int j = MathHelper.floor_double((par2AxisAlignedBB.maxX + MAX_ENTITY_RADIUS) / 16.0D);
    int k = MathHelper.floor_double((par2AxisAlignedBB.minZ - MAX_ENTITY_RADIUS) / 16.0D);
    int l = MathHelper.floor_double((par2AxisAlignedBB.maxZ + MAX_ENTITY_RADIUS) / 16.0D);

    for (int i1 = i; i1 <= j; ++i1)
    {
        for (int j1 = k; j1 <= l; ++j1)
        {
            if (this.chunkExists(i1, j1))
            {
                this.getChunkFromChunkCoords(i1, j1).getEntitiesWithinAABBForEntity(par1Entity, par2AxisAlignedBB, arraylist, par3IEntitySelector);
            }
        }
    }

    return arraylist;
}
 
Example 34
Project: RuneCraftery   File: World.java   Source Code and License 6 votes vote down vote up
public List selectEntitiesWithinAABB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector)
{
    int i = MathHelper.floor_double((par2AxisAlignedBB.minX - MAX_ENTITY_RADIUS) / 16.0D);
    int j = MathHelper.floor_double((par2AxisAlignedBB.maxX + MAX_ENTITY_RADIUS) / 16.0D);
    int k = MathHelper.floor_double((par2AxisAlignedBB.minZ - MAX_ENTITY_RADIUS) / 16.0D);
    int l = MathHelper.floor_double((par2AxisAlignedBB.maxZ + MAX_ENTITY_RADIUS) / 16.0D);
    ArrayList arraylist = new ArrayList();

    for (int i1 = i; i1 <= j; ++i1)
    {
        for (int j1 = k; j1 <= l; ++j1)
        {
            if (this.chunkExists(i1, j1))
            {
                this.getChunkFromChunkCoords(i1, j1).getEntitiesOfTypeWithinAAAB(par1Class, par2AxisAlignedBB, arraylist, par3IEntitySelector);
            }
        }
    }

    return arraylist;
}
 
Example 35
Project: RuneCraftery   File: EntityMinecartHopper.java   Source Code and License 6 votes vote down vote up
public boolean func_96112_aD()
{
    if (TileEntityHopper.suckItemsIntoHopper(this))
    {
        return true;
    }
    else
    {
        List list = this.worldObj.selectEntitiesWithinAABB(EntityItem.class, this.boundingBox.expand(0.25D, 0.0D, 0.25D), IEntitySelector.selectAnything);

        if (list.size() > 0)
        {
            TileEntityHopper.insertStackFromEntity(this, (EntityItem)list.get(0));
        }

        return false;
    }
}
 
Example 36
Project: RuneCraftery   File: BlockDetectorRail.java   Source Code and License 6 votes vote down vote up
/**
 * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal
 * strength when this block inputs to a comparator.
 */
public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5)
{
    if ((par1World.getBlockMetadata(par2, par3, par4) & 8) > 0)
    {
        float f = 0.125F;
        List list = par1World.selectEntitiesWithinAABB(EntityMinecart.class, AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + f), (double)par3, (double)((float)par4 + f), (double)((float)(par2 + 1) - f), (double)((float)(par3 + 1) - f), (double)((float)(par4 + 1) - f)), IEntitySelector.selectInventories);

        if (list.size() > 0)
        {
            return Container.calcRedstoneFromInventory((IInventory)list.get(0));
        }
    }

    return 0;
}
 
Example 37
Project: BetterNutritionMod   File: World.java   Source Code and License 6 votes vote down vote up
public List getEntitiesWithinAABBExcludingEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector)
{
    ArrayList arraylist = new ArrayList();
    int i = MathHelper.floor_double((par2AxisAlignedBB.minX - MAX_ENTITY_RADIUS) / 16.0D);
    int j = MathHelper.floor_double((par2AxisAlignedBB.maxX + MAX_ENTITY_RADIUS) / 16.0D);
    int k = MathHelper.floor_double((par2AxisAlignedBB.minZ - MAX_ENTITY_RADIUS) / 16.0D);
    int l = MathHelper.floor_double((par2AxisAlignedBB.maxZ + MAX_ENTITY_RADIUS) / 16.0D);

    for (int i1 = i; i1 <= j; ++i1)
    {
        for (int j1 = k; j1 <= l; ++j1)
        {
            if (this.chunkExists(i1, j1))
            {
                this.getChunkFromChunkCoords(i1, j1).getEntitiesWithinAABBForEntity(par1Entity, par2AxisAlignedBB, arraylist, par3IEntitySelector);
            }
        }
    }

    return arraylist;
}
 
Example 38
Project: BetterNutritionMod   File: World.java   Source Code and License 6 votes vote down vote up
public List selectEntitiesWithinAABB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector)
{
    int i = MathHelper.floor_double((par2AxisAlignedBB.minX - MAX_ENTITY_RADIUS) / 16.0D);
    int j = MathHelper.floor_double((par2AxisAlignedBB.maxX + MAX_ENTITY_RADIUS) / 16.0D);
    int k = MathHelper.floor_double((par2AxisAlignedBB.minZ - MAX_ENTITY_RADIUS) / 16.0D);
    int l = MathHelper.floor_double((par2AxisAlignedBB.maxZ + MAX_ENTITY_RADIUS) / 16.0D);
    ArrayList arraylist = new ArrayList();

    for (int i1 = i; i1 <= j; ++i1)
    {
        for (int j1 = k; j1 <= l; ++j1)
        {
            if (this.chunkExists(i1, j1))
            {
                this.getChunkFromChunkCoords(i1, j1).getEntitiesOfTypeWithinAAAB(par1Class, par2AxisAlignedBB, arraylist, par3IEntitySelector);
            }
        }
    }

    return arraylist;
}
 
Example 39
Project: BetterNutritionMod   File: EntityMinecartHopper.java   Source Code and License 6 votes vote down vote up
public boolean func_96112_aD()
{
    if (TileEntityHopper.suckItemsIntoHopper(this))
    {
        return true;
    }
    else
    {
        List list = this.worldObj.selectEntitiesWithinAABB(EntityItem.class, this.boundingBox.expand(0.25D, 0.0D, 0.25D), IEntitySelector.selectAnything);

        if (list.size() > 0)
        {
            TileEntityHopper.insertStackFromEntity(this, (EntityItem)list.get(0));
        }

        return false;
    }
}
 
Example 40
Project: BetterNutritionMod   File: BlockDetectorRail.java   Source Code and License 6 votes vote down vote up
/**
 * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal
 * strength when this block inputs to a comparator.
 */
public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5)
{
    if ((par1World.getBlockMetadata(par2, par3, par4) & 8) > 0)
    {
        float f = 0.125F;
        List list = par1World.selectEntitiesWithinAABB(EntityMinecart.class, AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + f), (double)par3, (double)((float)par4 + f), (double)((float)(par2 + 1) - f), (double)((float)(par3 + 1) - f), (double)((float)(par4 + 1) - f)), IEntitySelector.selectInventories);

        if (list.size() > 0)
        {
            return Container.calcRedstoneFromInventory((IInventory)list.get(0));
        }
    }

    return 0;
}
 
Example 41
Project: PneumaticCraft   File: ProgWidgetAreaItemBase.java   Source Code and License 6 votes vote down vote up
public static List<Entity> getEntitiesInArea(ProgWidgetArea whitelistWidget, ProgWidgetArea blacklistWidget, World world, IEntitySelector whitelistFilter, IEntitySelector blacklistFilter){
    if(whitelistWidget == null) return new ArrayList<Entity>();
    Set<Entity> entities = new HashSet<Entity>();
    ProgWidgetArea widget = whitelistWidget;
    while(widget != null) {
        entities.addAll(widget.getEntitiesWithinArea(world, whitelistFilter));
        widget = (ProgWidgetArea)widget.getConnectedParameters()[0];
    }
    widget = blacklistWidget;
    while(widget != null) {
        entities.removeAll(widget.getEntitiesWithinArea(world, whitelistFilter));
        widget = (ProgWidgetArea)widget.getConnectedParameters()[0];
    }
    if(blacklistFilter != null) {
        Entity[] entArray = entities.toArray(new Entity[entities.size()]);
        for(Entity entity : entArray) {
            if(blacklistFilter.isEntityApplicable(entity)) {
                entities.remove(entity);
            }
        }
    }
    return new ArrayList<Entity>(entities);
}
 
Example 42
Project: connor41-etfuturum2   File: EntityEndermite.java   Source Code and License 5 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
public void onLivingUpdate() {
	super.onLivingUpdate();

	if (worldObj.isRemote)
		for (int i = 0; i < 2; i++)
			worldObj.spawnParticle("portal", posX + (rand.nextDouble() - 0.5D) * width, posY + rand.nextDouble() * height, posZ + (rand.nextDouble() - 0.5D) * width, (rand.nextDouble() - 0.5D) * 2.0D, -rand.nextDouble(), (rand.nextDouble() - 0.5D) * 2.0D);
	else {
		if (!isNoDespawnRequired())
			lifetime++;

		if (lifetime >= 2400)
			setDead();
	}

	if (isSpawnedByPlayer()) {
		double range = 64;
		double radius = range / 2.0;
		int tagetChance = 10;
		if (rand.nextInt(tagetChance) != 0) {
			List<EntityEnderman> list = worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getBoundingBox(posX - radius, posY - 4, posZ - radius, posX + radius, posY + 4, posZ + radius), new IEntitySelector() {
				@Override
				public boolean isEntityApplicable(Entity entity) {
					return entity instanceof EntityEnderman;
				}
			});
			Collections.sort(list, sorter);
			if (!list.isEmpty()) {
				EntityEnderman enderman = list.get(0);
				enderman.setTarget(this);
			}
		}
	}
}
 
Example 43
Project: PopularMMOS-EpicProportions-Mod   File: TileEntityBlockChristmasPresents_Red.java   Source Code and License 5 votes vote down vote up
public static IInventory func_145893_b(World p_145893_0_, double p_145893_1_, double p_145893_3_, double p_145893_5_)
{
    IInventory iinventory = null;
    int i = MathHelper.floor_double(p_145893_1_);
    int j = MathHelper.floor_double(p_145893_3_);
    int k = MathHelper.floor_double(p_145893_5_);
    TileEntity tileentity = p_145893_0_.getTileEntity(i, j, k);

    if (tileentity != null && tileentity instanceof IInventory)
    {
        iinventory = (IInventory)tileentity;

        if (iinventory instanceof TileEntityChest)
        {
            Block block = p_145893_0_.getBlock(i, j, k);

            if (block instanceof BlockChest)
            {
                iinventory = ((BlockChest)block).func_149951_m(p_145893_0_, i, j, k);
            }
        }
    }

    if (iinventory == null)
    {
        List list = p_145893_0_.getEntitiesWithinAABBExcludingEntity((Entity)null, AxisAlignedBB.getBoundingBox(p_145893_1_, p_145893_3_, p_145893_5_, p_145893_1_ + 1.0D, p_145893_3_ + 1.0D, p_145893_5_ + 1.0D), IEntitySelector.selectInventories);

        if (list != null && list.size() > 0)
        {
            iinventory = (IInventory)list.get(p_145893_0_.rand.nextInt(list.size()));
        }
    }

    return iinventory;
}
 
Example 44
Project: FiveNightsAtFreddysUniverseMod   File: EntityBonnieAINearestAttackableTarget.java   Source Code and License 5 votes vote down vote up
public EntityBonnieAINearestAttackableTarget(EntityBonnie p_i1665_1_, Class p_i1665_2_, int p_i1665_3_, boolean p_i1665_4_, boolean p_i1665_5_, final IEntitySelector p_i1665_6_)
{
	super(p_i1665_1_, p_i1665_4_, p_i1665_5_);
	this.targetClass = p_i1665_2_;
	this.targetChance = p_i1665_3_;
	this.theNearestAttackableTargetSorter = new EntityBonnieAINearestAttackableTarget.Sorter(p_i1665_1_);
	this.setMutexBits(1);
	this.targetEntitySelector = new IEntitySelector()
	{
		public boolean isEntityApplicable(Entity p_82704_1_)
		{
			return !(p_82704_1_ instanceof EntityLivingBase) ? false : (p_i1665_6_ != null && !p_i1665_6_.isEntityApplicable(p_82704_1_) ? false : EntityBonnieAINearestAttackableTarget.this.isSuitableTarget((EntityLivingBase)p_82704_1_, false));
		}
	};
}
 
Example 45
Project: FiveNightsAtFreddysUniverseMod   File: EntityCandyAINearestAttackableTarget.java   Source Code and License 5 votes vote down vote up
public EntityCandyAINearestAttackableTarget(EntityCandy p_i1665_1_, Class p_i1665_2_, int p_i1665_3_, boolean p_i1665_4_, boolean p_i1665_5_, final IEntitySelector p_i1665_6_)
{
	super(p_i1665_1_, p_i1665_4_, p_i1665_5_);
	this.targetClass = p_i1665_2_;
	this.targetChance = p_i1665_3_;
	this.theNearestAttackableTargetSorter = new EntityCandyAINearestAttackableTarget.Sorter(p_i1665_1_);
	this.setMutexBits(1);
	this.targetEntitySelector = new IEntitySelector()
	{
		public boolean isEntityApplicable(Entity p_82704_1_)
		{
			return !(p_82704_1_ instanceof EntityLivingBase) ? false : (p_i1665_6_ != null && !p_i1665_6_.isEntityApplicable(p_82704_1_) ? false : EntityCandyAINearestAttackableTarget.this.isSuitableTarget((EntityLivingBase)p_82704_1_, false));
		}
	};
}
 
Example 46
Project: FiveNightsAtFreddysUniverseMod   File: EntityChicaAINearestAttackableTarget.java   Source Code and License 5 votes vote down vote up
public EntityChicaAINearestAttackableTarget(EntityChica p_i1665_1_, Class p_i1665_2_, int p_i1665_3_, boolean p_i1665_4_, boolean p_i1665_5_, final IEntitySelector p_i1665_6_)
{
	super(p_i1665_1_, p_i1665_4_, p_i1665_5_);
	this.targetClass = p_i1665_2_;
	this.targetChance = p_i1665_3_;
	this.theNearestAttackableTargetSorter = new EntityChicaAINearestAttackableTarget.Sorter(p_i1665_1_);
	this.setMutexBits(1);
	this.targetEntitySelector = new IEntitySelector()
	{
		public boolean isEntityApplicable(Entity p_82704_1_)
		{
			return !(p_82704_1_ instanceof EntityLivingBase) ? false : (p_i1665_6_ != null && !p_i1665_6_.isEntityApplicable(p_82704_1_) ? false : EntityChicaAINearestAttackableTarget.this.isSuitableTarget((EntityLivingBase)p_82704_1_, false));
		}
	};
}
 
Example 47
Project: FiveNightsAtFreddysUniverseMod   File: EntityFredbearAINearestAttackableTarget.java   Source Code and License 5 votes vote down vote up
public EntityFredbearAINearestAttackableTarget(EntityFredbear p_i1665_1_, Class p_i1665_2_, int p_i1665_3_, boolean p_i1665_4_, boolean p_i1665_5_, final IEntitySelector p_i1665_6_)
{
	super(p_i1665_1_, p_i1665_4_, p_i1665_5_);
	this.targetClass = p_i1665_2_;
	this.targetChance = p_i1665_3_;
	this.theNearestAttackableTargetSorter = new EntityFredbearAINearestAttackableTarget.Sorter(p_i1665_1_);
	this.setMutexBits(1);
	this.targetEntitySelector = new IEntitySelector()
	{
		public boolean isEntityApplicable(Entity p_82704_1_)
		{
			return !(p_82704_1_ instanceof EntityLivingBase) ? false : (p_i1665_6_ != null && !p_i1665_6_.isEntityApplicable(p_82704_1_) ? false : EntityFredbearAINearestAttackableTarget.this.isSuitableTarget((EntityLivingBase)p_82704_1_, false));
		}
	};
}
 
Example 48
Project: FiveNightsAtFreddysUniverseMod   File: EntitySpringbonnieAINearestAttackableTarget.java   Source Code and License 5 votes vote down vote up
public EntitySpringbonnieAINearestAttackableTarget(EntitySpringbonnie p_i1665_1_, Class p_i1665_2_, int p_i1665_3_, boolean p_i1665_4_, boolean p_i1665_5_, final IEntitySelector p_i1665_6_)
{
	super(p_i1665_1_, p_i1665_4_, p_i1665_5_);
	this.targetClass = p_i1665_2_;
	this.targetChance = p_i1665_3_;
	this.theNearestAttackableTargetSorter = new EntitySpringbonnieAINearestAttackableTarget.Sorter(p_i1665_1_);
	this.setMutexBits(1);
	this.targetEntitySelector = new IEntitySelector()
	{
		public boolean isEntityApplicable(Entity p_82704_1_)
		{
			return !(p_82704_1_ instanceof EntityLivingBase) ? false : (p_i1665_6_ != null && !p_i1665_6_.isEntityApplicable(p_82704_1_) ? false : EntitySpringbonnieAINearestAttackableTarget.this.isSuitableTarget((EntityLivingBase)p_82704_1_, false));
		}
	};
}
 
Example 49
Project: FiveNightsAtFreddysUniverseMod   File: EntityTBonnieAINearestAttackableTarget.java   Source Code and License 5 votes vote down vote up
public EntityTBonnieAINearestAttackableTarget(EntityToyBonnie p_i1665_1_, Class p_i1665_2_, int p_i1665_3_, boolean p_i1665_4_, boolean p_i1665_5_, final IEntitySelector p_i1665_6_)
{
	super(p_i1665_1_, p_i1665_4_, p_i1665_5_);
	this.targetClass = p_i1665_2_;
	this.targetChance = p_i1665_3_;
	this.theNearestAttackableTargetSorter = new EntityTBonnieAINearestAttackableTarget.Sorter(p_i1665_1_);
	this.setMutexBits(1);
	this.targetEntitySelector = new IEntitySelector()
	{
		public boolean isEntityApplicable(Entity p_82704_1_)
		{
			return !(p_82704_1_ instanceof EntityLivingBase) ? false : (p_i1665_6_ != null && !p_i1665_6_.isEntityApplicable(p_82704_1_) ? false : EntityTBonnieAINearestAttackableTarget.this.isSuitableTarget((EntityLivingBase)p_82704_1_, false));
		}
	};
}
 
Example 50
Project: FiveNightsAtFreddysUniverseMod   File: EntityWBonnieAINearestAttackableTarget.java   Source Code and License 5 votes vote down vote up
public EntityWBonnieAINearestAttackableTarget(EntityWBonnie p_i1665_1_, Class p_i1665_2_, int p_i1665_3_, boolean p_i1665_4_, boolean p_i1665_5_, final IEntitySelector p_i1665_6_)
{
	super(p_i1665_1_, p_i1665_4_, p_i1665_5_);
	this.targetClass = p_i1665_2_;
	this.targetChance = p_i1665_3_;
	this.theNearestAttackableTargetSorter = new EntityWBonnieAINearestAttackableTarget.Sorter(p_i1665_1_);
	this.setMutexBits(1);
	this.targetEntitySelector = new IEntitySelector()
	{
		public boolean isEntityApplicable(Entity p_82704_1_)
		{
			return !(p_82704_1_ instanceof EntityLivingBase) ? false : (p_i1665_6_ != null && !p_i1665_6_.isEntityApplicable(p_82704_1_) ? false : EntityWBonnieAINearestAttackableTarget.this.isSuitableTarget((EntityLivingBase)p_82704_1_, false));
		}
	};
}
 
Example 51
Project: FiveNightsAtFreddysUniverseMod   File: EntityPuppetAINearestAttackableTarget.java   Source Code and License 5 votes vote down vote up
public EntityPuppetAINearestAttackableTarget(EntityPuppet p_i1665_1_, Class p_i1665_2_, int p_i1665_3_, boolean p_i1665_4_, boolean p_i1665_5_, final IEntitySelector p_i1665_6_)
{
	super(p_i1665_1_, p_i1665_4_, p_i1665_5_);
	this.targetClass = p_i1665_2_;
	this.targetChance = p_i1665_3_;
	this.theNearestAttackableTargetSorter = new EntityPuppetAINearestAttackableTarget.Sorter(p_i1665_1_);
	this.setMutexBits(1);
	this.targetEntitySelector = new IEntitySelector()
	{
		public boolean isEntityApplicable(Entity p_82704_1_)
		{
			return !(p_82704_1_ instanceof EntityLivingBase) ? false : (p_i1665_6_ != null && !p_i1665_6_.isEntityApplicable(p_82704_1_) ? false : EntityPuppetAINearestAttackableTarget.this.isSuitableTarget((EntityLivingBase)p_82704_1_, false));
		}
	};
}
 
Example 52
Project: FiveNightsAtFreddysUniverseMod   File: EntitySpringtrapAINearestAttackableTarget.java   Source Code and License 5 votes vote down vote up
public EntitySpringtrapAINearestAttackableTarget(EntitySpringtrap p_i1665_1_, Class p_i1665_2_, int p_i1665_3_, boolean p_i1665_4_, boolean p_i1665_5_, final IEntitySelector p_i1665_6_)
{
	super(p_i1665_1_, p_i1665_4_, p_i1665_5_);
	this.targetClass = p_i1665_2_;
	this.targetChance = p_i1665_3_;
	this.theNearestAttackableTargetSorter = new EntitySpringtrapAINearestAttackableTarget.Sorter(p_i1665_1_);
	this.setMutexBits(1);
	this.targetEntitySelector = new IEntitySelector()
	{
		public boolean isEntityApplicable(Entity p_82704_1_)
		{
			return !(p_82704_1_ instanceof EntityLivingBase) ? false : (p_i1665_6_ != null && !p_i1665_6_.isEntityApplicable(p_82704_1_) ? false : EntitySpringtrapAINearestAttackableTarget.this.isSuitableTarget((EntityLivingBase)p_82704_1_, false));
		}
	};
}
 
Example 53
Project: FiveNightsAtFreddysUniverseMod   File: EntityFoxyAINearestAttackableTarget.java   Source Code and License 5 votes vote down vote up
public EntityFoxyAINearestAttackableTarget(EntityFoxy p_i1665_1_, Class p_i1665_2_, int p_i1665_3_, boolean p_i1665_4_, boolean p_i1665_5_, final IEntitySelector p_i1665_6_)
{
	super(p_i1665_1_, p_i1665_4_, p_i1665_5_);
	this.targetClass = p_i1665_2_;
	this.targetChance = p_i1665_3_;
	this.theNearestAttackableTargetSorter = new EntityFoxyAINearestAttackableTarget.Sorter(p_i1665_1_);
	this.setMutexBits(1);
	this.targetEntitySelector = new IEntitySelector()
	{
		public boolean isEntityApplicable(Entity p_82704_1_)
		{
			return !(p_82704_1_ instanceof EntityLivingBase) ? false : (p_i1665_6_ != null && !p_i1665_6_.isEntityApplicable(p_82704_1_) ? false : EntityFoxyAINearestAttackableTarget.this.isSuitableTarget((EntityLivingBase)p_82704_1_, false));
		}
	};
}
 
Example 54
Project: FiveNightsAtFreddysUniverseMod   File: EntityTFreddyAINearestAttackableTarget.java   Source Code and License 5 votes vote down vote up
public EntityTFreddyAINearestAttackableTarget(EntityToyFreddy p_i1665_1_, Class p_i1665_2_, int p_i1665_3_, boolean p_i1665_4_, boolean p_i1665_5_, final IEntitySelector p_i1665_6_)
{
	super(p_i1665_1_, p_i1665_4_, p_i1665_5_);
	this.targetClass = p_i1665_2_;
	this.targetChance = p_i1665_3_;
	this.theNearestAttackableTargetSorter = new EntityTFreddyAINearestAttackableTarget.Sorter(p_i1665_1_);
	this.setMutexBits(1);
	this.targetEntitySelector = new IEntitySelector()
	{
		public boolean isEntityApplicable(Entity p_82704_1_)
		{
			return !(p_82704_1_ instanceof EntityLivingBase) ? false : (p_i1665_6_ != null && !p_i1665_6_.isEntityApplicable(p_82704_1_) ? false : EntityTFreddyAINearestAttackableTarget.this.isSuitableTarget((EntityLivingBase)p_82704_1_, false));
		}
	};
}
 
Example 55
Project: FiveNightsAtFreddysUniverseMod   File: EntityMinirinaAINearestAttackableTarget.java   Source Code and License 5 votes vote down vote up
public EntityMinirinaAINearestAttackableTarget(EntityMinirina p_i1665_1_, Class p_i1665_2_, int p_i1665_3_, boolean p_i1665_4_, boolean p_i1665_5_, final IEntitySelector p_i1665_6_)
{
	super(p_i1665_1_, p_i1665_4_, p_i1665_5_);
	this.targetClass = p_i1665_2_;
	this.targetChance = p_i1665_3_;
	this.theNearestAttackableTargetSorter = new EntityMinirinaAINearestAttackableTarget.Sorter(p_i1665_1_);
	this.setMutexBits(1);
	this.targetEntitySelector = new IEntitySelector()
	{
		public boolean isEntityApplicable(Entity p_82704_1_)
		{
			return !(p_82704_1_ instanceof EntityLivingBase) ? false : (p_i1665_6_ != null && !p_i1665_6_.isEntityApplicable(p_82704_1_) ? false : EntityMinirinaAINearestAttackableTarget.this.isSuitableTarget((EntityLivingBase)p_82704_1_, false));
		}
	};
}
 
Example 56
Project: FiveNightsAtFreddysUniverseMod   File: EntityFuntimeFreddyAINearestAttackableTarget.java   Source Code and License 5 votes vote down vote up
public EntityFuntimeFreddyAINearestAttackableTarget(EntityFuntimeFreddy p_i1665_1_, Class p_i1665_2_, int p_i1665_3_, boolean p_i1665_4_, boolean p_i1665_5_, final IEntitySelector p_i1665_6_)
{
	super(p_i1665_1_, p_i1665_4_, p_i1665_5_);
	this.targetClass = p_i1665_2_;
	this.targetChance = p_i1665_3_;
	this.theNearestAttackableTargetSorter = new EntityFuntimeFreddyAINearestAttackableTarget.Sorter(p_i1665_1_);
	this.setMutexBits(1);
	this.targetEntitySelector = new IEntitySelector()
	{
		public boolean isEntityApplicable(Entity p_82704_1_)
		{
			return !(p_82704_1_ instanceof EntityLivingBase) ? false : (p_i1665_6_ != null && !p_i1665_6_.isEntityApplicable(p_82704_1_) ? false : EntityFuntimeFreddyAINearestAttackableTarget.this.isSuitableTarget((EntityLivingBase)p_82704_1_, false));
		}
	};
}
 
Example 57
Project: FiveNightsAtFreddysUniverseMod   File: EntityPre_MangleAINearestAttackableTarget.java   Source Code and License 5 votes vote down vote up
public EntityPre_MangleAINearestAttackableTarget(EntityPre_Mangle p_i1665_1_, Class p_i1665_2_, int p_i1665_3_, boolean p_i1665_4_, boolean p_i1665_5_, final IEntitySelector p_i1665_6_)
{
	super(p_i1665_1_, p_i1665_4_, p_i1665_5_);
	this.targetClass = p_i1665_2_;
	this.targetChance = p_i1665_3_;
	this.theNearestAttackableTargetSorter = new EntityPre_MangleAINearestAttackableTarget.Sorter(p_i1665_1_);
	this.setMutexBits(1);
	this.targetEntitySelector = new IEntitySelector()
	{
		public boolean isEntityApplicable(Entity p_82704_1_)
		{
			return !(p_82704_1_ instanceof EntityLivingBase) ? false : (p_i1665_6_ != null && !p_i1665_6_.isEntityApplicable(p_82704_1_) ? false : EntityPre_MangleAINearestAttackableTarget.this.isSuitableTarget((EntityLivingBase)p_82704_1_, false));
		}
	};
}
 
Example 58
Project: FiveNightsAtFreddysUniverseMod   File: EntityWFreddyAINearestAttackableTarget.java   Source Code and License 5 votes vote down vote up
public EntityWFreddyAINearestAttackableTarget(EntityWFreddy p_i1665_1_, Class p_i1665_2_, int p_i1665_3_, boolean p_i1665_4_, boolean p_i1665_5_, final IEntitySelector p_i1665_6_)
{
	super(p_i1665_1_, p_i1665_4_, p_i1665_5_);
	this.targetClass = p_i1665_2_;
	this.targetChance = p_i1665_3_;
	this.theNearestAttackableTargetSorter = new EntityWFreddyAINearestAttackableTarget.Sorter(p_i1665_1_);
	this.setMutexBits(1);
	this.targetEntitySelector = new IEntitySelector()
	{
		public boolean isEntityApplicable(Entity p_82704_1_)
		{
			return !(p_82704_1_ instanceof EntityLivingBase) ? false : (p_i1665_6_ != null && !p_i1665_6_.isEntityApplicable(p_82704_1_) ? false : EntityWFreddyAINearestAttackableTarget.this.isSuitableTarget((EntityLivingBase)p_82704_1_, false));
		}
	};
}
 
Example 59
Project: FiveNightsAtFreddysUniverseMod   File: EntityFreddyAINearestAttackableTarget.java   Source Code and License 5 votes vote down vote up
public EntityFreddyAINearestAttackableTarget(EntityFreddy p_i1665_1_, Class p_i1665_2_, int p_i1665_3_, boolean p_i1665_4_, boolean p_i1665_5_, final IEntitySelector p_i1665_6_)
{
	super(p_i1665_1_, p_i1665_4_, p_i1665_5_);
	this.targetClass = p_i1665_2_;
	this.targetChance = p_i1665_3_;
	this.theNearestAttackableTargetSorter = new EntityFreddyAINearestAttackableTarget.Sorter(p_i1665_1_);
	this.setMutexBits(1);
	this.targetEntitySelector = new IEntitySelector()
	{
		public boolean isEntityApplicable(Entity p_82704_1_)
		{
			return !(p_82704_1_ instanceof EntityLivingBase) ? false : (p_i1665_6_ != null && !p_i1665_6_.isEntityApplicable(p_82704_1_) ? false : EntityFreddyAINearestAttackableTarget.this.isSuitableTarget((EntityLivingBase)p_82704_1_, false));
		}
	};
}
 
Example 60
Project: FiveNightsAtFreddysUniverseMod   File: EntityGoldenFreddyAINearestAttackableTarget.java   Source Code and License 5 votes vote down vote up
public EntityGoldenFreddyAINearestAttackableTarget(EntityGoldenFreddy p_i1665_1_, Class p_i1665_2_, int p_i1665_3_, boolean p_i1665_4_, boolean p_i1665_5_, final IEntitySelector p_i1665_6_)
{
	super(p_i1665_1_, p_i1665_4_, p_i1665_5_);
	this.targetClass = p_i1665_2_;
	this.targetChance = p_i1665_3_;
	this.theNearestAttackableTargetSorter = new EntityGoldenFreddyAINearestAttackableTarget.Sorter(p_i1665_1_);
	this.setMutexBits(1);
	this.targetEntitySelector = new IEntitySelector()
	{
		public boolean isEntityApplicable(Entity p_82704_1_)
		{
			return !(p_82704_1_ instanceof EntityLivingBase) ? false : (p_i1665_6_ != null && !p_i1665_6_.isEntityApplicable(p_82704_1_) ? false : EntityGoldenFreddyAINearestAttackableTarget.this.isSuitableTarget((EntityLivingBase)p_82704_1_, false));
		}
	};
}