block1 = Blocks.FARMLAND; world.playSound(null, pos, block1.getSoundType().getStepSound(), SoundCategory.BLOCKS, (block1.getSoundType().getVolume() + 1.0F) / 2.0F, block1.getSoundType().getPitch() * 0.8F);
public static void playStepSound(@Nonnull SoundType snd, @Nonnull World world, @Nonnull BlockPos pos) { SoundHelper.playSound(world, pos, new Sound(snd.getStepSound()), (snd.getVolume() + 1.0F) / 2.0F, snd.getPitch() * 0.8F); }
/** * Plays step sound at given x, y, z for the entity */ public void playStepSound(BlockPos entityPos, Block block) { // no sounds for eggs or underwater action if (dragon.isEgg() || dragon.isInWater()) { return; } // override sound type if the top block is snowy SoundType soundType; if (dragon.worldObj.getBlockState(entityPos.up()).getBlock() == Blocks.SNOW_LAYER) { soundType = Blocks.SNOW_LAYER.getSoundType(); } else { soundType = block.getSoundType(); } // play stomping for bigger dragons SoundEvent stepSound; if (dragon.isHatchling()) { stepSound = soundType.getStepSound(); } else { stepSound = getStepSound(); } playSound(stepSound, soundType.getVolume(), soundType.getPitch()); }
entity.playSound(soundtype.getStepSound(), soundtype.getVolume() * 0.15F, soundtype.getPitch()); } else if (!block.getDefaultState().getMaterial().isLiquid()) { entity.playSound(soundtype.getStepSound(), soundtype.getVolume() * 0.15F, soundtype.getPitch());
world.playSound(null, newPos, Blocks.FARMLAND.getSoundType().getStepSound(), SoundCategory.BLOCKS, (Blocks.FARMLAND.getSoundType().getVolume() + 1.0F) / 2.0F, Blocks.FARMLAND.getSoundType().getPitch() * 0.8F); hasSoundPlayed = true;