List of usage examples for net.minecraftforge.client.event.sound PlaySoundEvent getName
public String getName()
From source file:org.blockartistry.DynSurround.client.handlers.SoundEffectHandler.java
License:MIT License
@SubscribeEvent public void soundPlay(@Nonnull final PlaySoundEvent e) { if (e.getName().equals("entity.lightning.thunder")) { final ISound sound = e.getSound(); final BlockPos pos = new BlockPos(sound.getXPosF(), sound.getYPosF(), sound.getZPosF()); final ISound newSound = Sounds.THUNDER.createSound(pos).setVolume(ModOptions.thunderVolume); e.setResultSound(newSound);//from w w w. j a v a2 s. com } }
From source file:org.blockartistry.mod.DynSurround.client.PlayerSoundEffectHandler.java
License:MIT License
@SubscribeEvent public void soundEvent(final PlaySoundEvent event) { if (event.getSound() == null) return;/*from w ww . j a v a2s . co m*/ if ((ModOptions.alwaysOverrideSound || !StormProperties.doVanilla()) && replaceRainSound(event.getName())) { final ISound sound = event.getSound(); event.setResultSound(new PositionedSoundRecord(StormProperties.getCurrentStormSound(), SoundCategory.WEATHER, StormProperties.getCurrentVolume(), sound.getPitch(), sound.getXPosF(), sound.getYPosF(), sound.getZPosF())); return; } }