Skip to content
This repository has been archived by the owner on Mar 12, 2023. It is now read-only.

Commit

Permalink
Cancel all background music. Closes #6
Browse files Browse the repository at this point in the history
  • Loading branch information
Vazkii committed Dec 27, 2015
1 parent 6dbb7ba commit a15776c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/vazkii/ambience/Ambience.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.client.audio.MusicTicker;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.sound.PlayBackgroundMusicEvent;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod;
Expand Down Expand Up @@ -118,6 +119,12 @@ public void onRenderOverlay(RenderGameOverlayEvent.Text event) {
}
}

@SubscribeEvent
public void onBackgroundMusic(PlayBackgroundMusicEvent event) {
if(SongLoader.enabled)
event.setCanceled(true);
}

public void changeSongTo(String song) {
thread.play(song);
}
Expand Down

0 comments on commit a15776c

Please sign in to comment.