public boolean func_46082_a() {
   if (!field_48392_a.func_48139_F_()) {
     return false;
   }
   EntityLiving entityliving = field_48392_a.func_48144_ah();
   if (entityliving == null) {
     return false;
   } else {
     field_48391_b = entityliving.func_48088_aP();
     return func_48376_a(field_48391_b, false);
   }
 }
예제 #2
0
  /** Sets the active target the Task system uses for tracking */
  public void setAttackTarget(EntityLiving par1EntityLiving) {
    super.setAttackTarget(par1EntityLiving);

    if (par1EntityLiving instanceof EntityPlayer) {
      this.setAngry(true);
    }
  }
예제 #3
0
파일: wolf.java 프로젝트: Bioace/DarkCore
  /** (abstract) Protected helper method to read subclass entity data from NBT. */
  public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {
    super.readEntityFromNBT(par1NBTTagCompound);
    this.setAngry(par1NBTTagCompound.getBoolean("Angry"));

    if (par1NBTTagCompound.hasKey("CollarColor")) {
      this.setCollarColor(par1NBTTagCompound.getByte("CollarColor"));
    }
  }
예제 #4
0
파일: wolf.java 프로젝트: Bioace/DarkCore
  /** Sets the active target the Task system uses for tracking */
  public void setAttackTarget(EntityLivingBase par1EntityLivingBase) {
    super.setAttackTarget(par1EntityLivingBase);

    if (par1EntityLivingBase == null) {
      this.setAngry(false);
    } else if (!this.isTamed()) {
      this.setAngry(true);
    }
  }
예제 #5
0
파일: wolf.java 프로젝트: Bioace/DarkCore
  public void setTamed(boolean par1) {
    super.setTamed(par1);

    if (par1) {
      this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(20.0D);
    } else {
      this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(8.0D);
    }
  }
예제 #6
0
파일: wolf.java 프로젝트: Bioace/DarkCore
  /** Called to update the entity's position/logic. */
  public void onUpdate() {
    super.onUpdate();
    this.field_70924_f = this.field_70926_e;

    if (this.func_70922_bv()) {
      this.field_70926_e += (1.0F - this.field_70926_e) * 0.4F;
    } else {
      this.field_70926_e += (0.0F - this.field_70926_e) * 0.4F;
    }

    if (this.func_70922_bv()) {
      this.numTicksToChaseTarget = 10;
    }

    if (this.isWet()) {
      this.isShaking = true;
      this.field_70928_h = false;
      this.timeWolfIsShaking = 0.0F;
      this.prevTimeWolfIsShaking = 0.0F;
    } else if ((this.isShaking || this.field_70928_h) && this.field_70928_h) {
      if (this.timeWolfIsShaking == 0.0F) {
        this.playSound(
            "mob.wolf.shake",
            this.getSoundVolume(),
            (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
      }

      this.prevTimeWolfIsShaking = this.timeWolfIsShaking;
      this.timeWolfIsShaking += 0.05F;

      if (this.prevTimeWolfIsShaking >= 2.0F) {
        this.isShaking = false;
        this.field_70928_h = false;
        this.prevTimeWolfIsShaking = 0.0F;
        this.timeWolfIsShaking = 0.0F;
      }

      if (this.timeWolfIsShaking > 0.4F) {
        float f = (float) this.boundingBox.minY;
        int i = (int) (MathHelper.sin((this.timeWolfIsShaking - 0.4F) * (float) Math.PI) * 7.0F);

        for (int j = 0; j < i; ++j) {
          float f1 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F;
          float f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F;
          this.worldObj.spawnParticle(
              "splash",
              this.posX + (double) f1,
              (double) (f + 0.8F),
              this.posZ + (double) f2,
              this.motionX,
              this.motionY,
              this.motionZ);
        }
      }
    }
  }
예제 #7
0
파일: wolf.java 프로젝트: Bioace/DarkCore
 @SideOnly(Side.CLIENT)
 public void handleHealthUpdate(byte par1) {
   if (par1 == 8) {
     this.field_70928_h = true;
     this.timeWolfIsShaking = 0.0F;
     this.prevTimeWolfIsShaking = 0.0F;
   } else {
     super.handleHealthUpdate(par1);
   }
 }
예제 #8
0
파일: wolf.java 프로젝트: Bioace/DarkCore
  protected void applyEntityAttributes() {
    super.applyEntityAttributes();
    this.getEntityAttribute(SharedMonsterAttributes.movementSpeed)
        .setAttribute(0.30000001192092896D);

    if (this.isTamed()) {
      this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(20.0D);
    } else {
      this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(8.0D);
    }
  }
예제 #9
0
파일: wolf.java 프로젝트: Bioace/DarkCore
  /**
   * Called frequently so the entity can update its state every tick as required. For example,
   * zombies and skeletons use this to react to sunlight and start to burn.
   */
  public void onLivingUpdate() {
    super.onLivingUpdate();

    if (!this.worldObj.isRemote
        && this.isShaking
        && !this.field_70928_h
        && !this.hasPath()
        && this.onGround) {
      this.field_70928_h = true;
      this.timeWolfIsShaking = 0.0F;
      this.prevTimeWolfIsShaking = 0.0F;
      this.worldObj.setEntityState(this, (byte) 8);
    }
  }
예제 #10
0
파일: wolf.java 프로젝트: Bioace/DarkCore
 /** (abstract) Protected helper method to write subclass entity data to NBT. */
 public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {
   super.writeEntityToNBT(par1NBTTagCompound);
   par1NBTTagCompound.setBoolean("Angry", this.isAngry());
   par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor());
 }
예제 #11
0
파일: wolf.java 프로젝트: Bioace/DarkCore
 protected void entityInit() {
   super.entityInit();
   this.dataWatcher.addObject(18, new Float(this.getHealth()));
   this.dataWatcher.addObject(19, new Byte((byte) 0));
   this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1)));
 }
예제 #12
0
 /** (abstract) Protected helper method to read subclass entity data from NBT. */
 public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {
   super.readEntityFromNBT(par1NBTTagCompound);
   this.setTameSkin(par1NBTTagCompound.getInteger("CatType"));
 }
예제 #13
0
 /** (abstract) Protected helper method to write subclass entity data to NBT. */
 public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {
   super.writeEntityToNBT(par1NBTTagCompound);
   par1NBTTagCompound.setInteger("CatType", this.func_48375_r());
 }
예제 #14
0
 protected void entityInit() {
   super.entityInit();
   this.dataWatcher.addObject(18, Byte.valueOf((byte) 0));
 }
예제 #15
0
 protected void entityInit() {
   super.entityInit();
   this.dataWatcher.addObject(18, new Integer(this.getHealth()));
   this.dataWatcher.addObject(19, new Byte((byte) 0));
   this.dataWatcher.addObject(20, new Byte((byte) BlockCloth.getBlockFromDye(1)));
 }