• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java StepSound类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.minecraft.block.StepSound的典型用法代码示例。如果您正苦于以下问题:Java StepSound类的具体用法?Java StepSound怎么用?Java StepSound使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



StepSound类属于net.minecraft.block包,在下文中一共展示了StepSound类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: fall

import net.minecraft.block.StepSound; //导入依赖的package包/类
/**
 * 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);
        }
    }
}
 
开发者ID:NovaViper,项目名称:ZeroQuest,代码行数:27,代码来源:EntityJakan.java


示例2: playStepSound

import net.minecraft.block.StepSound; //导入依赖的package包/类
/**
 * 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());
        }
    }
}
 
开发者ID:Stormister,项目名称:Rediscovered-Mod-1.6.4,代码行数:26,代码来源:EntitySkeletonHorse.java


示例3: func_70069_a

import net.minecraft.block.StepSound; //导入依赖的package包/类
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);
      }
   }

}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:22,代码来源:EntityLivingBase.java


示例4: func_70069_a

import net.minecraft.block.StepSound; //导入依赖的package包/类
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);
      }

   }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:21,代码来源:EntityHorse.java


示例5: func_70036_a

import net.minecraft.block.StepSound; //导入依赖的package包/类
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());
      }
   }

}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:27,代码来源:EntityHorse.java


示例6: WetIce

import net.minecraft.block.StepSound; //导入依赖的package包/类
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);
}
 
开发者ID:Tommsy64,项目名称:Learning-to-Mod,代码行数:18,代码来源:WetIce.java


示例7: fall

import net.minecraft.block.StepSound; //导入依赖的package包/类
/**
 * 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);
        }
    }
}
 
开发者ID:Stormister,项目名称:Rediscovered-Mod-1.6.4,代码行数:31,代码来源:EntitySkeletonHorse.java


示例8: func_70036_a

import net.minecraft.block.StepSound; //导入依赖的package包/类
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());
   }

}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:11,代码来源:Entity.java


示例9: playStepSound

import net.minecraft.block.StepSound; //导入依赖的package包/类
/**
 * 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());
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:18,代码来源:Entity.java


示例10: fall

import net.minecraft.block.StepSound; //导入依赖的package包/类
/**
 * 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);
        }
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:34,代码来源:EntityLivingBase.java


示例11: func_71884_a

import net.minecraft.block.StepSound; //导入依赖的package包/类
public Block func_71884_a(StepSound p_71884_1_) {
   this.field_72020_cn = p_71884_1_;
   return this;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:5,代码来源:Block.java


示例12: playStepSound

import net.minecraft.block.StepSound; //导入依赖的package包/类
/**
 * 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());
        }
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:45,代码来源:EntityHorse.java


示例13: BlockAnvil

import net.minecraft.block.StepSound; //导入依赖的package包/类
public BlockAnvil(int i) {
	super(i, Material.wood);
	setHardness(1f);
	setStepSound(new StepSound("pixelmon.anvilHits", 1, 1));
}
 
开发者ID:uzzaco2002,项目名称:secri,代码行数:6,代码来源:BlockAnvil.java



注:本文中的net.minecraft.block.StepSound类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Location类代码示例发布时间:2022-05-23
下一篇:
Java Path类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap