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;
|
|
|
|
|
2013-10-18 02:53:08 +02:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|