package net.battlefield;

import net.minecraftforge.client.event.sound.SoundLoadEvent;
import net.minecraftforge.event.ForgeSubscribe;

public class AudioHandler 
{
	private static String[] soundNames = {
		"bfsounds/Gunshot.ogg", 
		"bfsounds/Sniper.ogg", 
		"bfsounds/Rocket.ogg", 
		//"bfsounds/Pistol.ogg", 
		//"bfsounds/Rifle.ogg", 
	};
	
    @ForgeSubscribe
    public void onSound(SoundLoadEvent event)
    {
        try 
        {
        	event.manager.soundPoolSounds.addSound(soundNames[0], Battlefield.class.getResource("/resources/newsound/" + soundNames[0]));
        	event.manager.soundPoolSounds.addSound(soundNames[1], Battlefield.class.getResource("/resources/newsound/" + soundNames[1]));
        	event.manager.soundPoolSounds.addSound(soundNames[2], Battlefield.class.getResource("/resources/newsound/" + soundNames[2]));
        	event.manager.soundPoolSounds.addSound(soundNames[3], Battlefield.class.getResource("/resources/newsound/" + soundNames[3]));
        	//event.manager.soundPoolSounds.addSound(soundNames[4], Battlefield.class.getResource("/resources/newsound/" + soundNames[4]));
        	//event.manager.soundPoolSounds.addSound(soundNames[5], Battlefield.class.getResource("/resources/newsound/" + soundNames[5]));
        	//event.manager.soundPoolSounds.addSound(soundNames[6], Battlefield.class.getResource("/resources/newsound/" + soundNames[6]));
        } 
        catch (Exception e)
        {
            System.err.println("Failed to register one or more sounds.");
        }
    }
}
