Various Updates #144
@@ -218,24 +218,29 @@ public class EventHookContainer
|
|||||||
|
|
||||||
public void playMusicForDim(World world)
|
public void playMusicForDim(World world)
|
||||||
{
|
{
|
||||||
if(world.isRemote)
|
if (world.isRemote)
|
||||||
{
|
{
|
||||||
SoundManager sndManager = FMLClientHandler.instance().getClient().sndManager;
|
SoundManager sndManager = FMLClientHandler.instance().getClient().sndManager;
|
||||||
|
|
||||||
if(world.provider instanceof LimboProvider)
|
// SenseiKiwi: I've added the following check as a quick fix for a reported crash.
|
||||||
{
|
// This needs to work without a hitch or we have to stop trying to replace the background music...
|
||||||
sndManager.sndSystem.stop("BgMusic");
|
if (sndManager != null && sndManager.sndSystem != null)
|
||||||
SoundPoolEntry soundPoolEntry = sndManager.soundPoolSounds.getRandomSoundFromSoundPool(mod_pocketDim.modid+":creepy");
|
{
|
||||||
if(soundPoolEntry!=null)
|
if (world.provider instanceof LimboProvider)
|
||||||
{
|
{
|
||||||
sndManager.sndSystem.backgroundMusic("LimboMusic", soundPoolEntry.getSoundUrl(), soundPoolEntry.getSoundName(), false);
|
sndManager.sndSystem.stop("BgMusic");
|
||||||
sndManager.sndSystem.play("LimboMusic");
|
SoundPoolEntry soundPoolEntry = sndManager.soundPoolSounds.getRandomSoundFromSoundPool(mod_pocketDim.modid+":creepy");
|
||||||
}
|
if (soundPoolEntry != null)
|
||||||
}
|
{
|
||||||
else if(!(world.provider instanceof LimboProvider))
|
sndManager.sndSystem.backgroundMusic("LimboMusic", soundPoolEntry.getSoundUrl(), soundPoolEntry.getSoundName(), false);
|
||||||
{
|
sndManager.sndSystem.play("LimboMusic");
|
||||||
sndManager.sndSystem.stop("LimboMusic");
|
}
|
||||||
}
|
}
|
||||||
|
else if (!(world.provider instanceof LimboProvider))
|
||||||
|
{
|
||||||
|
sndManager.sndSystem.stop("LimboMusic");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user