/** * Called when the mob is falling. Calculates and applies fall damage. */ protected void fall(float par1) { int i = MathHelper.ceiling_float_int(par1 * 0.5F - 10.0F); if (i > 0) { this.attackEntityFrom(DamageSource.fall, (float)i); if (this.riddenByEntity != null) { this.riddenByEntity.attackEntityFrom(DamageSource.fall, (float)i); } int j = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY - 0.2D - (double)this.prevRotationYaw), MathHelper.floor_double(this.posZ)); if (j > 0) { StepSound stepsound = Block.blocksList[j].stepSound; this.worldObj.playSoundAtEntity(this, stepsound.getStepSound(), stepsound.getVolume() * 0.5F, stepsound.getPitch() * 0.75F); } } }
/** * Plays step sound at given x, y, z for the entity */ protected void playStepSound(int par1, int par2, int par3, int par4) { StepSound stepsound = Block.blocksList[par4].stepSound; if (this.worldObj.getBlockId(par1, par2 + 1, par3) == Block.snow.blockID) { stepsound = Block.snow.stepSound; } if (!Block.blocksList[par4].blockMaterial.isLiquid()) { if (stepsound == Block.soundWoodFootstep) { this.playSound("mob.horse.soft", stepsound.getVolume() * 0.15F, stepsound.getPitch()); } else { this.playSound("mob.horse.wood", stepsound.getVolume() * 0.15F, stepsound.getPitch()); } } }
protected void func_70069_a(float p_70069_1_) { super.func_70069_a(p_70069_1_); PotionEffect var2 = this.func_70660_b(Potion.field_76430_j); float var3 = var2 != null?(float)(var2.func_76458_c() + 1):0.0F; int var4 = MathHelper.func_76123_f(p_70069_1_ - 3.0F - var3); if(var4 > 0) { if(var4 > 4) { this.func_85030_a("damage.fallbig", 1.0F, 1.0F); } else { this.func_85030_a("damage.fallsmall", 1.0F, 1.0F); } this.func_70097_a(DamageSource.field_76379_h, (float)var4); int var5 = this.field_70170_p.func_72798_a(MathHelper.func_76128_c(this.field_70165_t), MathHelper.func_76128_c(this.field_70163_u - 0.20000000298023224D - (double)this.field_70129_M), MathHelper.func_76128_c(this.field_70161_v)); if(var5 > 0) { StepSound var6 = Block.field_71973_m[var5].field_72020_cn; this.func_85030_a(var6.func_72675_d(), var6.func_72677_b() * 0.5F, var6.func_72678_c() * 0.75F); } } }
protected void func_70069_a(float p_70069_1_) { if(p_70069_1_ > 1.0F) { this.func_85030_a("mob.horse.land", 0.4F, 1.0F); } int var2 = MathHelper.func_76123_f(p_70069_1_ * 0.5F - 3.0F); if(var2 > 0) { this.func_70097_a(DamageSource.field_76379_h, (float)var2); if(this.field_70153_n != null) { this.field_70153_n.func_70097_a(DamageSource.field_76379_h, (float)var2); } int var3 = this.field_70170_p.func_72798_a(MathHelper.func_76128_c(this.field_70165_t), MathHelper.func_76128_c(this.field_70163_u - 0.2D - (double)this.field_70126_B), MathHelper.func_76128_c(this.field_70161_v)); if(var3 > 0) { StepSound var4 = Block.field_71973_m[var3].field_72020_cn; this.field_70170_p.func_72956_a(this, var4.func_72675_d(), var4.func_72677_b() * 0.5F, var4.func_72678_c() * 0.75F); } } }
protected void func_70036_a(int p_70036_1_, int p_70036_2_, int p_70036_3_, int p_70036_4_) { StepSound var5 = Block.field_71973_m[p_70036_4_].field_72020_cn; if(this.field_70170_p.func_72798_a(p_70036_1_, p_70036_2_ + 1, p_70036_3_) == Block.field_72037_aS.field_71990_ca) { var5 = Block.field_72037_aS.field_72020_cn; } if(!Block.field_71973_m[p_70036_4_].field_72018_cp.func_76224_d()) { int var6 = this.func_110265_bP(); if(this.field_70153_n != null && var6 != 1 && var6 != 2) { ++this.field_110285_bP; if(this.field_110285_bP > 5 && this.field_110285_bP % 3 == 0) { this.func_85030_a("mob.horse.gallop", var5.func_72677_b() * 0.15F, var5.func_72678_c()); if(var6 == 0 && this.field_70146_Z.nextInt(10) == 0) { this.func_85030_a("mob.horse.breathe", var5.func_72677_b() * 0.6F, var5.func_72678_c()); } } else if(this.field_110285_bP <= 5) { this.func_85030_a("mob.horse.wood", var5.func_72677_b() * 0.15F, var5.func_72678_c()); } } else if(var5 == Block.field_71967_e) { this.func_85030_a("mob.horse.soft", var5.func_72677_b() * 0.15F, var5.func_72678_c()); } else { this.func_85030_a("mob.horse.wood", var5.func_72677_b() * 0.15F, var5.func_72678_c()); } } }
public WetIce(int id) { super(id, Material.ice); this.setHardness(0.5F); this.setLightOpacity(3); this.slipperiness = 1.05F; this.setUnlocalizedName(Names.wetIce_unlocalizedName); StepSound soundWetIceFootstep = new StepSound("wetIceFootstep", 1.0F, 1.0F); this.setStepSound(soundWetIceFootstep); this.setCreativeTab(CreativeTabs.tabAllSearch); this.setCreativeTab(CreativeTabs.tabBlock); this.setCreativeTab(IceCraft.IceCraftTab); }
/** * Called when the mob is falling. Calculates and applies fall damage. */ protected void fall(float par1) { if (par1 > 1.0F) { this.playSound("mob.horse.land", 0.4F, 1.0F); } int i = MathHelper.ceiling_float_int(par1 * 0.5F - 3.0F); if (i > 0) { this.attackEntityFrom(DamageSource.fall, (float)i); if (this.riddenByEntity != null) { this.riddenByEntity.attackEntityFrom(DamageSource.fall, (float)i); } int j = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY - 0.2D - (double)this.prevRotationYaw), MathHelper.floor_double(this.posZ)); if (j > 0) { StepSound stepsound = Block.blocksList[j].stepSound; this.worldObj.playSoundAtEntity(this, stepsound.getStepSound(), stepsound.getVolume() * 0.5F, stepsound.getPitch() * 0.75F); } } }
protected void func_70036_a(int p_70036_1_, int p_70036_2_, int p_70036_3_, int p_70036_4_) { StepSound var5 = Block.field_71973_m[p_70036_4_].field_72020_cn; if(this.field_70170_p.func_72798_a(p_70036_1_, p_70036_2_ + 1, p_70036_3_) == Block.field_72037_aS.field_71990_ca) { var5 = Block.field_72037_aS.field_72020_cn; this.func_85030_a(var5.func_72675_d(), var5.func_72677_b() * 0.15F, var5.func_72678_c()); } else if(!Block.field_71973_m[p_70036_4_].field_72018_cp.func_76224_d()) { this.func_85030_a(var5.func_72675_d(), var5.func_72677_b() * 0.15F, var5.func_72678_c()); } }
/** * Plays step sound at given x, y, z for the entity */ protected void playStepSound(int par1, int par2, int par3, int par4) { StepSound stepsound = Block.blocksList[par4].stepSound; if (this.worldObj.getBlockId(par1, par2 + 1, par3) == Block.snow.blockID) { stepsound = Block.snow.stepSound; this.playSound(stepsound.getStepSound(), stepsound.getVolume() * 0.15F, stepsound.getPitch()); } else if (!Block.blocksList[par4].blockMaterial.isLiquid()) { this.playSound(stepsound.getStepSound(), stepsound.getVolume() * 0.15F, stepsound.getPitch()); } }
/** * Called when the mob is falling. Calculates and applies fall damage. */ protected void fall(float par1) { par1 = ForgeHooks.onLivingFall(this, par1); if (par1 <= 0) return; super.fall(par1); PotionEffect potioneffect = this.getActivePotionEffect(Potion.jump); float f1 = potioneffect != null ? (float)(potioneffect.getAmplifier() + 1) : 0.0F; int i = MathHelper.ceiling_float_int(par1 - 3.0F - f1); if (i > 0) { if (i > 4) { this.playSound("damage.fallbig", 1.0F, 1.0F); } else { this.playSound("damage.fallsmall", 1.0F, 1.0F); } this.attackEntityFrom(DamageSource.fall, (float)i); int j = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY - 0.20000000298023224D - (double)this.yOffset), MathHelper.floor_double(this.posZ)); if (j > 0) { StepSound stepsound = Block.blocksList[j].stepSound; this.playSound(stepsound.getStepSound(), stepsound.getVolume() * 0.5F, stepsound.getPitch() * 0.75F); } } }
public Block func_71884_a(StepSound p_71884_1_) { this.field_72020_cn = p_71884_1_; return this; }
/** * Plays step sound at given x, y, z for the entity */ protected void playStepSound(int par1, int par2, int par3, int par4) { StepSound stepsound = Block.blocksList[par4].stepSound; if (this.worldObj.getBlockId(par1, par2 + 1, par3) == Block.snow.blockID) { stepsound = Block.snow.stepSound; } if (!Block.blocksList[par4].blockMaterial.isLiquid()) { int i1 = this.getHorseType(); if (this.riddenByEntity != null && i1 != 1 && i1 != 2) { ++this.field_110285_bP; if (this.field_110285_bP > 5 && this.field_110285_bP % 3 == 0) { this.playSound("mob.horse.gallop", stepsound.getVolume() * 0.15F, stepsound.getPitch()); if (i1 == 0 && this.rand.nextInt(10) == 0) { this.playSound("mob.horse.breathe", stepsound.getVolume() * 0.6F, stepsound.getPitch()); } } else if (this.field_110285_bP <= 5) { this.playSound("mob.horse.wood", stepsound.getVolume() * 0.15F, stepsound.getPitch()); } } else if (stepsound == Block.soundWoodFootstep) { this.playSound("mob.horse.soft", stepsound.getVolume() * 0.15F, stepsound.getPitch()); } else { this.playSound("mob.horse.wood", stepsound.getVolume() * 0.15F, stepsound.getPitch()); } } }
public BlockAnvil(int i) { super(i, Material.wood); setHardness(1f); setStepSound(new StepSound("pixelmon.anvilHits", 1, 1)); }