Package net.minecraft.src

Examples of net.minecraft.src.Entity


        boundingBox.expand(f, f, f));
    for (int x = 0; x < list.size(); x++)
      if (list.get(x) instanceof Dragon)
        list.remove(x);
    if (list.size() > 0) {
      Entity e = (Entity) list.get(rand.nextInt(list.size()));
      while (!canEntityBeSeen(e))
        e = (Entity) list.get(rand.nextInt(list.size()));
      return e;
    } else
      return null;
View Full Code Here


    return true;
  }

  public boolean attackEntityFrom(DamageSource par1DamageSource, int par2) {
    Entity entity = par1DamageSource.getEntity();

    if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) {
      par2 = (par2 + 1) / 2;
    }
    if (entity instanceof EntityArrow) {
View Full Code Here

    List list = worldObj.getEntitiesWithinAABBExcludingEntity(exploder,
        AxisAlignedBB.getBoundingBoxFromPool(k, k1, i2, i1, l1, j2));
    Vec3D vec3d = Vec3D.createVector(explosionX, explosionY, explosionZ);

    for (int k2 = 0; k2 < list.size(); k2++) {
      Entity entity = (Entity) list.get(k2);
      double d4 = entity.getDistance(explosionX, explosionY, explosionZ)
          / (double) explosionSize;

      if (d4 <= 1.0D) {
        double d6 = entity.posX - explosionX;
        double d8 = entity.posY - explosionY;
        double d10 = entity.posZ - explosionZ;
        double d11 = MathHelper.sqrt_double(d6 * d6 + d8 * d8 + d10 * d10);
        d6 /= d11;
        d8 /= d11;
        d10 /= d11;
        double d12 = worldObj.getBlockDensity(vec3d, entity.boundingBox);
        double d13 = (1.0D - d4) * d12;
        // entity.attackEntityFrom(DamageSource.explosion, (int)(((d13 *
        // d13 + d13) / 2D) * 8D * (double)explosionSize + 1.0D));
        entity.setFire(300);
        double d14 = d13;
        entity.motionX += d6 * d14;
        entity.motionY += d8 * d14;
        entity.motionZ += d10 * d14;
      }
 
View Full Code Here

        vec3d1 = Vec3D.createVector(posX + motionX, posY + motionY, posZ + motionZ);
        if(movingobjectposition != null)
        {
            vec3d1 = Vec3D.createVector(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
        }
        Entity entity = null;
        List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.addCoord(motionX, motionY, motionZ).expand(1.0D, 1.0D, 1.0D));
        double d = 0.0D;
        for(int j = 0; j < list.size(); j++)
        {
            Entity entity1 = (Entity)list.get(j);
            if(!entity1.canBeCollidedWith() || entity1.isEntityEqual(shootingEntity) && ticksInAir < 25)
            {
                continue;
            }
            float f2 = 0.3F;
            AxisAlignedBB axisalignedbb = entity1.boundingBox.expand(f2, f2, f2);
View Full Code Here

    List list = worldObj.getEntitiesWithinAABBExcludingEntity(exploder,
        AxisAlignedBB.getBoundingBoxFromPool(k, k1, i2, i1, l1, j2));
    Vec3D vec3d = Vec3D.createVector(explosionX, explosionY, explosionZ);

    for (int k2 = 0; k2 < list.size(); k2++) {
      Entity entity = (Entity) list.get(k2);
      double d4 = entity.getDistance(explosionX, explosionY, explosionZ)
          / (double) explosionSize;

      if (d4 <= 1.0D) {
        double d6 = entity.posX - explosionX;
        double d8 = entity.posY - explosionY;
        double d10 = entity.posZ - explosionZ;
        double d11 = MathHelper.sqrt_double(d6 * d6 + d8 * d8 + d10 * d10);
        d6 /= d11;
        d8 /= d11;
        d10 /= d11;
        double d12 = worldObj.getBlockDensity(vec3d, entity.boundingBox);
        double d13 = (1.0D - d4) * d12;
        // entity.attackEntityFrom(DamageSource.explosion, (int)(((d13 *
        // d13 + d13) / 2D) * 8D * (double)explosionSize + 1.0D));
        entity.setFire(0);
        Magic.Destruction.icespike(worldObj, entity.posX, entity.posY, entity.posZ);
        double d14 = d13;
        entity.motionX += d6 * d14;
        entity.motionY += d8 * d14;
        entity.motionZ += d10 * d14;
 
View Full Code Here

    vec3d1 = Vec3D.createVector(posX + motionX, posY + motionY, posZ + motionZ);
    if (movingobjectposition != null) {
      vec3d1 = Vec3D.createVector(movingobjectposition.hitVec.xCoord,
          movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord);
    }
    Entity entity = null;
    List list = worldObj.getEntitiesWithinAABBExcludingEntity(this,
        boundingBox.addCoord(motionX, motionY, motionZ).expand(1.0D, 1.0D, 1.0D));
    double d = 0.0D;
    for (int l = 0; l < list.size(); l++) {
      Entity entity1 = (Entity) list.get(l);
      if (!entity1.canBeCollidedWith() || entity1 == shootingEntity && ticksInAir < 5) {
        continue;
      }
      float f5 = 0.3F;
      AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand(f5, f5, f5);
      MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec3d,
View Full Code Here

 
    public boolean attackEntityFrom(DamageSource damagesource, int i)
    {
        if (super.attackEntityFrom(damagesource, i))
        {
            Entity entity = damagesource.getEntity();
            if (riddenByEntity == entity || ridingEntity == entity)
                return true;
            if (entity != this)
            {
                entityToAttack = entity;
View Full Code Here

    return true;
  }

  public boolean attackEntityFrom(DamageSource par1DamageSource, int par2) {
    Entity entity = par1DamageSource.getEntity();

    if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow)) {
      par2 = (par2 + 1) / 2;
    }
View Full Code Here

TOP

Related Classes of net.minecraft.src.Entity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.