public EntityThrowable(World par1World, EntityLiving par2EntityLiving) {
   super(par1World);
   xTile = -1;
   yTile = -1;
   zTile = -1;
   inTile = 0;
   inGround = false;
   throwableShake = 0;
   ticksInAir = 0;
   thrower = par2EntityLiving;
   setSize(0.25F, 0.25F);
   setLocationAndAngles(
       par2EntityLiving.posX,
       par2EntityLiving.posY + (double) par2EntityLiving.getEyeHeight(),
       par2EntityLiving.posZ,
       par2EntityLiving.rotationYaw,
       par2EntityLiving.rotationPitch);
   posX -= MathHelper.cos((rotationYaw / 180F) * (float) Math.PI) * 0.16F;
   posY -= 0.10000000149011612D;
   posZ -= MathHelper.sin((rotationYaw / 180F) * (float) Math.PI) * 0.16F;
   setPosition(posX, posY, posZ);
   yOffset = 0.0F;
   float f = 0.4F;
   motionX =
       -MathHelper.sin((rotationYaw / 180F) * (float) Math.PI)
           * MathHelper.cos((rotationPitch / 180F) * (float) Math.PI)
           * f;
   motionZ =
       MathHelper.cos((rotationYaw / 180F) * (float) Math.PI)
           * MathHelper.cos((rotationPitch / 180F) * (float) Math.PI)
           * f;
   motionY = -MathHelper.sin(((rotationPitch + func_40074_d()) / 180F) * (float) Math.PI) * f;
   setThrowableHeading(motionX, motionY, motionZ, func_40077_c(), 1.0F);
 }
Beispiel #2
0
  public EntityNutsCall(
      World par1World,
      EntityLiving par2EntityLiving,
      EntityLiving par3EntityLiving,
      float par4,
      float par5) {
    super(par1World);
    isImmuneToFire = true;
    this.renderDistanceWeight = 10.0D;
    this.shootingEntity = par2EntityLiving;

    if (par2EntityLiving instanceof EntityPlayer) {
      this.canBePickedUp = 1;
    }

    this.posY =
        par2EntityLiving.posY + (double) par2EntityLiving.getEyeHeight() - 0.10000000149011612D;
    double d0 = par3EntityLiving.posX - par2EntityLiving.posX;
    double d1 =
        par3EntityLiving.boundingBox.minY + (double) (par3EntityLiving.height / 3.0F) - this.posY;
    double d2 = par3EntityLiving.posZ - par2EntityLiving.posZ;
    double d3 = (double) MathHelper.sqrt_double(d0 * d0 + d2 * d2);

    if (d3 >= 1.0E-7D) {
      float f2 = (float) (Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F;
      float f3 = (float) (-(Math.atan2(d1, d3) * 180.0D / Math.PI));
      double d4 = d0 / d3;
      double d5 = d2 / d3;
      this.setLocationAndAngles(
          par2EntityLiving.posX + d4, this.posY, par2EntityLiving.posZ + d5, f2, f3);
      this.yOffset = 0.0F;
      float f4 = (float) d3 * 0.2F;
      this.setThrowableHeading(d0, d1 + (double) f4, d2, par4, par5);
    }
  }
Beispiel #3
0
  public EntityNutsCall(World par1World, EntityLiving par2EntityLiving, float par3) {
    super(par1World);
    isImmuneToFire = true;
    this.renderDistanceWeight = 10.0D;
    this.shootingEntity = par2EntityLiving;

    if (par2EntityLiving instanceof EntityPlayer) {
      this.canBePickedUp = 1;
    }

    this.setSize(1.5F, 0.5F);
    this.setLocationAndAngles(
        par2EntityLiving.posX,
        par2EntityLiving.posY + (double) par2EntityLiving.getEyeHeight(),
        par2EntityLiving.posZ,
        par2EntityLiving.rotationYaw,
        par2EntityLiving.rotationPitch);
    this.posX -= (double) (MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F);
    this.posY -= 0.10000000149011612D;
    this.posZ -= (double) (MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F);
    this.setPosition(this.posX, this.posY, this.posZ);
    this.yOffset = 0.0F;
    this.motionX =
        (double)
            (-MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI)
                * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI));
    this.motionZ =
        (double)
            (MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI)
                * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI));
    this.motionY = (double) (-MathHelper.sin(this.rotationPitch / 180.0F * (float) Math.PI));
    this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, par3 * 1.5F, 1.0F);
  }
Beispiel #4
0
 public EntityPokeBall(
     World world, EntityLiving entityliving, EntityPixelmon e, EnumPokeballs type) {
   super(world, entityliving);
   thrower = entityliving;
   endRotationYaw = entityliving.rotationYawHead;
   pixelmon = e;
   dataWatcher.addObject(10, type.getIndex());
   mode = Mode.full;
   float speed = 0.3f;
   this.setLocationAndAngles(
       entityliving.posX,
       entityliving.posY + (double) entityliving.getEyeHeight(),
       entityliving.posZ,
       entityliving.rotationYaw,
       entityliving.rotationPitch);
   this.posX -= (double) (MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F);
   this.posY -= 0.10000000149011612D;
   this.posZ -= (double) (MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F);
   this.setPosition(this.posX, this.posY, this.posZ);
   this.yOffset = 0.0F;
   this.motionX =
       (double)
               (-MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI)
                   * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI))
           * 0.8;
   this.motionZ =
       (double)
               (MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI)
                   * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI))
           * 0.8;
   this.motionY = (double) (-MathHelper.sin(this.rotationPitch / 180.0F * (float) Math.PI)) * 0.8;
 }
Beispiel #5
0
 public EntityBKnife(World var1, EntityLiving var2) {
   super(var1);
   this.owner = var2;
   this.renderDistanceWeight = 10.0D;
   this.doesArrowBelongToPlayer = var2 instanceof EntityPlayer;
   this.setSize(0.5F, 0.5F);
   this.setLocationAndAngles(
       var2.posX,
       var2.posY + (double) var2.getEyeHeight(),
       var2.posZ,
       var2.rotationYaw,
       var2.rotationPitch);
   this.posX -= (double) (MathHelper.cos(this.rotationYaw / 180.0F * 3.141593F) * 0.16F);
   this.posY -= 0.10000000149011612D;
   this.posZ -= (double) (MathHelper.sin(this.rotationYaw / 180.0F * 3.141593F) * 0.16F);
   this.setPosition(this.posX, this.posY, this.posZ);
   this.yOffset = 0.0F;
   this.motionX =
       (double)
           (-MathHelper.sin(this.rotationYaw / 180.0F * 3.141593F)
               * MathHelper.cos(this.rotationPitch / 180.0F * 3.141593F));
   this.motionZ =
       (double)
           (MathHelper.cos(this.rotationYaw / 180.0F * 3.141593F)
               * MathHelper.cos(this.rotationPitch / 180.0F * 3.141593F));
   this.motionY = (double) (-MathHelper.sin(this.rotationPitch / 180.0F * 3.141593F));
   this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, 1.5F, 1.0F);
 }
Beispiel #6
0
 public EntityPokeBall(
     World world,
     EntityLiving thrower,
     EntityPixelmon target,
     EnumPokeballs type,
     BattleController battleController) {
   super(world, thrower);
   this.thrower = thrower;
   dropItem = false;
   endRotationYaw = thrower.rotationYawHead;
   pixelmon = target;
   dataWatcher.addObject(10, type.getIndex());
   dataWatcher.addObject(11, (short) 0); // IsCaptured
   dataWatcher.addObject(12, (short) 0); // IsWaiting
   dataWatcher.addObject(13, (short) 0); // IsOnGround
   dataWatcher.addObject(14, (short) 0); // IsOpen
   mode = Mode.battle;
   isBattleThrown = true;
   this.battleController = battleController;
   worldObj = thrower.worldObj;
   battleController.pauseBattle();
   this.setLocationAndAngles(
       thrower.posX,
       thrower.posY + (double) thrower.getEyeHeight(),
       thrower.posZ,
       thrower.rotationYaw,
       thrower.rotationPitch);
   this.posX -= (double) (MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F);
   this.posY -= 0.10000000149011612D;
   this.posZ -= (double) (MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F);
   this.setPosition(this.posX, this.posY, this.posZ);
   this.yOffset = 0.0F;
   isInitialized = true;
   Vec3 posVec =
       Vec3.createVectorHelper(posX - pixelmon.posX, posY - pixelmon.posY, posZ - pixelmon.posZ);
   this.motionX =
       (double)
               (-MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI)
                   * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI))
           * 0.8;
   this.motionZ =
       (double)
               (MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI)
                   * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI))
           * 0.8;
   this.motionY = (double) (-MathHelper.sin(0)) * 0.8;
 }