Java Code Examples for net.minecraft.entity.Entity#doesEntityNotTriggerPressurePlate()

The following examples show how to use net.minecraft.entity.Entity#doesEntityNotTriggerPressurePlate() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BlockPressurePlate.java    From customstuff4 with GNU General Public License v3.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
protected int computeRedstoneStrength(World worldIn, BlockPos pos)
{
    AxisAlignedBB axisalignedbb = PRESSURE_AABB.offset(pos);
    List<? extends Entity> list;

    Class<? extends Entity> selectedEntityClass = content.selector.getEntityClass();
    if (selectedEntityClass == null)
    {
        list = worldIn.getEntitiesWithinAABBExcludingEntity(null, axisalignedbb);
    } else
    {
        list = worldIn.getEntitiesWithinAABB(selectedEntityClass, axisalignedbb);
    }

    if (!list.isEmpty())
    {
        for (Entity entity : list)
        {
            if (!entity.doesEntityNotTriggerPressurePlate() && content.selector.isValidEntity(entity))
            {
                return 15;
            }
        }
    }

    return 0;
}
 
Example 2
Source File: BlockArtifactsPressurePlate.java    From Artifacts with MIT License 5 votes vote down vote up
@Override
//getPlateState
protected int func_150065_e(World world, int x, int y, int z)
{
	List list = null;

	if (this.triggerMobType == BlockPressurePlate.Sensitivity.everything)
	{
		list = world.getEntitiesWithinAABBExcludingEntity((Entity)null, this.func_150061_a/*getSensitiveAABB*/(x, y, z));
	}

	if (this.triggerMobType == BlockPressurePlate.Sensitivity.mobs)
	{
		list = world.getEntitiesWithinAABB(EntityLivingBase.class, this.func_150061_a(x, y, z));
	}

	if (this.triggerMobType == BlockPressurePlate.Sensitivity.players)
	{
		list = world.getEntitiesWithinAABB(EntityPlayer.class, this.func_150061_a(x, y, z));
	}

	if (!list.isEmpty())
	{
		Iterator iterator = list.iterator();

		while (iterator.hasNext())
		{
			Entity entity = (Entity)iterator.next();

			if (!entity.doesEntityNotTriggerPressurePlate())
			{
				return 15;
			}
		}
	}

	return 0;
}
 
Example 3
Source File: BlockWallPlate.java    From Artifacts with MIT License 5 votes vote down vote up
@Override
//getPlateState
protected int func_150065_e(World world, int x, int y, int z)
{
	List list = null;
	int meta = world.getBlockMetadata(x, y, z);
	if (this.triggerMobType == BlockPressurePlate.Sensitivity.everything)
	{
		list = world.getEntitiesWithinAABBExcludingEntity((Entity)null, this.getMetaSensitiveAABB(x, y, z, meta));
	}

	if (this.triggerMobType == BlockPressurePlate.Sensitivity.mobs)
	{
		list = world.getEntitiesWithinAABB(EntityLivingBase.class, this.getMetaSensitiveAABB(x, y, z, meta));
	}

	if (this.triggerMobType == BlockPressurePlate.Sensitivity.players)
	{
		list = world.getEntitiesWithinAABB(EntityPlayer.class, this.getMetaSensitiveAABB(x, y, z, meta));
	}

	if (!list.isEmpty())
	{
		Iterator iterator = list.iterator();

		while (iterator.hasNext())
		{
			Entity entity = (Entity)iterator.next();
			if (!entity.doesEntityNotTriggerPressurePlate())
			{
				return 15;
			}
		}
	}


	return 0;
}
 
Example 4
Source File: BlockLaserBeam.java    From Artifacts with MIT License 4 votes vote down vote up
private boolean updateTripWireState(World par1World, int par2, int par3, int par4)
{
    int l = par1World.getBlockMetadata(par2, par3, par4);
    boolean flag = (l & 1) == 1;
    boolean flag1 = false;
    List list = par1World.getEntitiesWithinAABBExcludingEntity((Entity)null, AxisAlignedBB.getBoundingBox((double)par2 + this.minX, (double)par3 + this.minY, (double)par4 + this.minZ, (double)par2 + this.maxX, (double)par3 + this.maxY, (double)par4 + this.maxZ));

    if (!list.isEmpty())
    {
        Iterator iterator = list.iterator();

        while (iterator.hasNext())
        {
            Entity entity = (Entity)iterator.next();
            if (entity instanceof EntityLivingBase && !entity.doesEntityNotTriggerPressurePlate())
            {
                flag1 = true;
                break;
            }
        }
    }

    if (flag1 && !flag)
    {
        l |= 1;
    }

    if (!flag1 && flag)
    {
        l &= -2;
    }
    boolean ff = false;
    if (flag1 != flag)
    {
        par1World.setBlockMetadataWithNotify(par2, par3, par4, l, 3);
        this.func_72149_e(par1World, par2, par3, par4, l);
        ff = true;
    }

    if (flag1)
    {
        par1World.scheduleBlockUpdate(par2, par3, par4, this.instance, this.tickRate(par1World));
    }
    return ff;
}
 
Example 5
Source File: BlockLaserBeamSource.java    From Artifacts with MIT License 4 votes vote down vote up
@Override
  public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
  {
//System.out.println("Collide");
      if (!par1World.isRemote)
      {
      	/*int m = par1World.getBlockMetadata(par2, par3, par4);
          if ((m & 8) != 8)
          {
          	par1World.setBlockMetadataWithNotify(par2, par3, par4, m, 3);
          }*/
      	int l = par1World.getBlockMetadata(par2, par3, par4);
          boolean flag = (l & 8) == 8;
      	boolean flag1 = false;
      	List list = par1World.getEntitiesWithinAABBExcludingEntity((Entity)null, AxisAlignedBB.getBoundingBox((double)par2 + this.minX, (double)par3 + this.minY, (double)par4 + this.minZ, (double)par2 + this.maxX, (double)par3 + this.maxY, (double)par4 + this.maxZ));

          if (!list.isEmpty())
          {
              Iterator iterator = list.iterator();

              while (iterator.hasNext())
              {
                  Entity entity = (Entity)iterator.next();

                  if (entity instanceof EntityLivingBase && !entity.doesEntityNotTriggerPressurePlate())
                  {
                      flag1 = true;
                      break;
                  }
              }
          }
          if (flag1 && !flag)
          {
              l |= 8;
              par1World.setBlockMetadataWithNotify(par2, par3, par4, l, 3);
              notifyNeighborOfChange(par1World, par2, par3, par4, l);
          //}
          //if (flag1)
          //{
              par1World.scheduleBlockUpdate(par2, par3, par4, this.instance, this.tickRate(par1World));
          }
      }
  }