/** (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"); } }
/** (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"); } }
@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); }
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); } }
/** 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); } }
/** 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_); } }
@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); } } }
/** 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"; }
public void a(NBTTagCompound nbttagcompound) { super.a(nbttagcompound); if (nbttagcompound.b("ExplosionPower", 99)) { this.a = nbttagcompound.f("ExplosionPower"); } }
/** (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); }
@Override public void readEntityFromNBT(NBTTagCompound compound) { super.readEntityFromNBT(compound); this.getEntityWorld().removeEntity(this); }
@Override public void updateAITasks() { super.updateAITasks(); }
public void s_() { super.s_(); if (!this.o.D && this.o.aa() == EnumDifficulty.PEACEFUL) { this.J(); } }
@Override public void onLivingUpdate() { super.onLivingUpdate(); }
public void b(NBTTagCompound nbttagcompound) { super.b(nbttagcompound); nbttagcompound.a("ExplosionPower", this.a); }
protected void entityInit() { super.entityInit(); this.dataWatcher.addObject(16, Byte.valueOf((byte) 0)); }
protected void h() { super.h(); this.ac.a(16, Byte.valueOf((byte) 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); }
protected void aW() { super.aW(); this.a(SharedMonsterAttributes.a).a(10.0D); this.a(SharedMonsterAttributes.b).a(100.0D); }
protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D); }
@Override public void entityInit() { super.entityInit(); }