Fixed limbo music

This commit is contained in:
CannibalVox 2015-03-10 04:03:45 -05:00
parent 07a986d39d
commit c72a03b558

View file

@ -87,7 +87,7 @@ public class EventHookContainer
public void onSoundEffectResult(PlaySoundEvent17 event) public void onSoundEffectResult(PlaySoundEvent17 event)
{ {
ResourceLocation playingSound = event.sound.getPositionedSoundLocation(); ResourceLocation playingSound = event.sound.getPositionedSoundLocation();
if (playingSound != null && playingSound.getResourceDomain().equals("minecraft") && playingSound.getResourcePath().equals("music.game")) { if (playingSound != null && playingSound.getResourceDomain().equals("minecraft") && (playingSound.getResourcePath().equals("music.game") || playingSound.getResourcePath().equals("music.game.creative"))) {
if (FMLClientHandler.instance().getClient().thePlayer.worldObj.provider.dimensionId == mod_pocketDim.properties.LimboDimensionID) { if (FMLClientHandler.instance().getClient().thePlayer.worldObj.provider.dimensionId == mod_pocketDim.properties.LimboDimensionID) {
ResourceLocation sound = new ResourceLocation(mod_pocketDim.modid + ":creepy"); ResourceLocation sound = new ResourceLocation(mod_pocketDim.modid + ":creepy");
@ -145,11 +145,8 @@ public class EventHookContainer
PocketManager.load(); PocketManager.load();
} }
if (FMLClientHandler.instance().getClient().thePlayer == null) if (event.world.provider.dimensionId == mod_pocketDim.properties.LimboDimensionID &&
return; event.world.isRemote && !Minecraft.getMinecraft().getSoundHandler().isSoundPlaying(limboMusic)) {
if (FMLClientHandler.instance().getClient().thePlayer.worldObj.provider.dimensionId == mod_pocketDim.properties.LimboDimensionID &&
!Minecraft.getMinecraft().getSoundHandler().isSoundPlaying(limboMusic)) {
Minecraft.getMinecraft().getSoundHandler().playSound(limboMusic); Minecraft.getMinecraft().getSoundHandler().playSound(limboMusic);
} }
} }