BiomesOPlenty/src/minecraft/biomesoplenty/handlers/SoundHandler.java

48 lines
1.3 KiB
Java
Raw Normal View History

2013-06-15 11:08:58 +00:00
package biomesoplenty.handlers;
import java.util.logging.Level;
import net.minecraft.client.resources.ResourceLocation;
import net.minecraftforge.client.event.sound.SoundLoadEvent;
import net.minecraftforge.event.ForgeSubscribe;
2013-06-15 11:08:58 +00:00
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
2013-06-15 11:08:58 +00:00
public class SoundHandler
{
static ResourceLocation[] recordSoundFiles = { new ResourceLocation("bopdisc.ogg"), new ResourceLocation("bopdiscmud.ogg") };
static String[] soundFiles = { };
2013-06-15 11:08:58 +00:00
@SideOnly(Side.CLIENT)
@ForgeSubscribe
public void onSoundLoad(SoundLoadEvent event)
2013-06-15 11:08:58 +00:00
{
for (String soundFile : soundFiles)
2013-06-15 11:08:58 +00:00
{
try
{
event.manager.soundPoolSounds.addSound(soundFile);
}
catch (Exception e)
2013-06-15 11:08:58 +00:00
{
FMLCommonHandler.instance().getFMLLogger().log(Level.WARNING, "[BiomesOPlenty] Failed loading sound file: " + soundFile);
2013-06-15 11:08:58 +00:00
}
}
for (ResourceLocation recordSoundFile : recordSoundFiles)
{
try
{
event.manager.soundPoolStreaming.addSound(recordSoundFile.func_110623_a());
}
catch (Exception e)
{
FMLCommonHandler.instance().getFMLLogger().log(Level.WARNING, "[BiomesOPlenty] Failed loading sound file: " + recordSoundFile);
}
}
}
2013-06-15 11:08:58 +00:00
}