equivalent-exchange-3/common/com/pahimar/ee3/client/audio/SoundHandler.java

36 lines
993 B
Java
Raw Normal View History

2013-08-23 16:59:50 +02:00
package com.pahimar.ee3.client.audio;
import net.minecraftforge.client.event.sound.SoundLoadEvent;
import net.minecraftforge.event.ForgeSubscribe;
import com.pahimar.ee3.core.helper.LogHelper;
2013-08-23 16:59:50 +02:00
import com.pahimar.ee3.lib.Sounds;
/**
* Equivalent-Exchange-3
*
* SoundHandler
*
* @author pahimar
* @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html)
*
*/
public class SoundHandler {
@ForgeSubscribe
public void onSoundLoad(SoundLoadEvent event) {
// For each custom sound file we have defined in Sounds
for (String soundFile : Sounds.soundFiles) {
// Try to add the custom sound file to the pool of sounds
try {
event.manager.addSound(soundFile);
}
// If we cannot add the custom sound file to the pool, log the exception
catch (Exception e) {
LogHelper.warning("Failed loading sound file: " + soundFile);
}
}
}
}