예제 #1
0
  /** (abstract) Protected helper method to read subclass entity data from NBT. */
  public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {
    super.readEntityFromNBT(par1NBTTagCompound);

    if (par1NBTTagCompound.hasKey("ExplosionPower")) {
      this.explosionStrength = par1NBTTagCompound.getInteger("ExplosionPower");
    }
  }
예제 #2
0
  /** (abstract) Protected helper method to read subclass entity data from NBT. */
  public void readEntityFromNBT(NBTTagCompound p_70037_1_) {
    super.readEntityFromNBT(p_70037_1_);

    if (p_70037_1_.func_150297_b("ExplosionPower", 99)) {
      this.explosionStrength = p_70037_1_.getInteger("ExplosionPower");
    }
  }
예제 #3
0
 @Override
 protected void applyEntityAttributes() {
   super.applyEntityAttributes();
   this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(1.0);
   this.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(0.25D);
   this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(2.0D);
   this.getAttributeMap().registerAttribute(SharedMonsterAttributes.ATTACK_DAMAGE);
   this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(6.0);
 }
예제 #4
0
 public boolean a(DamageSource damagesource, float f0) {
   if (this.b(damagesource)) {
     return false;
   } else if ("fireball".equals(damagesource.p()) && damagesource.j() instanceof EntityPlayer) {
     super.a(damagesource, 1000.0F);
     ((EntityPlayer) damagesource.j()).b((StatBase) AchievementList.z);
     return true;
   } else {
     return super.a(damagesource, f0);
   }
 }
예제 #5
0
 /** Called when the entity is attacked. */
 public boolean attackEntityFrom(DamageSource par1DamageSource, int par2) {
   if (this.isEntityInvulnerable()) {
     return false;
   } else if ("fireball".equals(par1DamageSource.getDamageType())
       && par1DamageSource.getEntity() instanceof EntityPlayer) {
     super.attackEntityFrom(par1DamageSource, 1000);
     ((EntityPlayer) par1DamageSource.getEntity()).triggerAchievement(AchievementList.ghast);
     return true;
   } else {
     return super.attackEntityFrom(par1DamageSource, par2);
   }
 }
예제 #6
0
 /** Called when the entity is attacked. */
 public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) {
   if (this.isEntityInvulnerable()) {
     return false;
   } else if ("fireball".equals(p_70097_1_.getDamageType())
       && p_70097_1_.getEntity() instanceof EntityPlayer) {
     super.attackEntityFrom(p_70097_1_, 1000.0F);
     ((EntityPlayer) p_70097_1_.getEntity()).triggerAchievement(AchievementList.ghast);
     return true;
   } else {
     return super.attackEntityFrom(p_70097_1_, p_70097_2_);
   }
 }
예제 #7
0
 @Override
 public void onUpdate() {
   super.onUpdate();
   lifetime--;
   if (lifetime == 0) {
     this.getEntityWorld().removeEntity(this);
   }
   if (target != null) {
     rotationYaw =
         (float)
             Math.toRadians(
                 Util.yawDegreesBetweenPoints(
                     posX,
                     posY,
                     posZ,
                     target.posX,
                     target.posY + target.getEyeHeight(),
                     target.posZ));
     rotationPitch =
         (float)
             Math.toRadians(
                 Util.pitchDegreesBetweenPoints(
                     posX,
                     posY,
                     posZ,
                     target.posX,
                     target.posY + target.getEyeHeight(),
                     target.posZ));
     Vec3d moveVec = Util.lookVector(this.rotationYaw, this.rotationPitch).scale(0.35f);
     this.setVelocity(
         0.5f * motionX + 0.5f * moveVec.xCoord,
         0.5f * motionY + 0.5f * moveVec.yCoord,
         0.5f * motionZ + 0.5f * moveVec.zCoord);
     for (double i = 0; i < 3; i++) {
       double x = prevPosX + (1.0 - i / 3.0) * (posX - prevPosX);
       double y = prevPosY + (1.0 - i / 3.0) * (posY - prevPosY);
       double z = prevPosZ + (1.0 - i / 3.0) * (posZ - prevPosZ);
       Roots.proxy.spawnParticleMagicAuraFX(
           getEntityWorld(),
           x,
           y,
           z,
           -0.125 * moveVec.xCoord,
           -0.125 * moveVec.yCoord,
           -0.125 * moveVec.zCoord,
           76,
           230,
           0);
     }
   }
 }
예제 #8
0
 /** Called to update the entity's position/logic. */
 public void onUpdate() {
   super.onUpdate();
   byte b0 = this.dataWatcher.getWatchableObjectByte(16);
   this.texture = b0 == 1 ? "/mob/ghast_fire.png" : "/mob/ghast.png";
 }
예제 #9
0
 public void a(NBTTagCompound nbttagcompound) {
   super.a(nbttagcompound);
   if (nbttagcompound.b("ExplosionPower", 99)) {
     this.a = nbttagcompound.f("ExplosionPower");
   }
 }
예제 #10
0
 /** (abstract) Protected helper method to write subclass entity data to NBT. */
 public void writeEntityToNBT(NBTTagCompound p_70014_1_) {
   super.writeEntityToNBT(p_70014_1_);
   p_70014_1_.setInteger("ExplosionPower", this.explosionStrength);
 }
예제 #11
0
 @Override
 public void readEntityFromNBT(NBTTagCompound compound) {
   super.readEntityFromNBT(compound);
   this.getEntityWorld().removeEntity(this);
 }
예제 #12
0
 @Override
 public void updateAITasks() {
   super.updateAITasks();
 }
예제 #13
0
 public void s_() {
   super.s_();
   if (!this.o.D && this.o.aa() == EnumDifficulty.PEACEFUL) {
     this.J();
   }
 }
예제 #14
0
 @Override
 public void onLivingUpdate() {
   super.onLivingUpdate();
 }
예제 #15
0
 public void b(NBTTagCompound nbttagcompound) {
   super.b(nbttagcompound);
   nbttagcompound.a("ExplosionPower", this.a);
 }
예제 #16
0
 protected void entityInit() {
   super.entityInit();
   this.dataWatcher.addObject(16, Byte.valueOf((byte) 0));
 }
예제 #17
0
 protected void h() {
   super.h();
   this.ac.a(16, Byte.valueOf((byte) 0));
 }
예제 #18
0
 /** (abstract) Protected helper method to write subclass entity data to NBT. */
 public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {
   super.writeEntityToNBT(par1NBTTagCompound);
   par1NBTTagCompound.setInteger("ExplosionPower", this.explosionStrength);
 }
예제 #19
0
 protected void aW() {
   super.aW();
   this.a(SharedMonsterAttributes.a).a(10.0D);
   this.a(SharedMonsterAttributes.b).a(100.0D);
 }
예제 #20
0
 protected void applyEntityAttributes() {
   super.applyEntityAttributes();
   this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D);
 }
예제 #21
0
 @Override
 public void entityInit() {
   super.entityInit();
 }