package eiteam.esteemedinnovation.commons.audio;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.ISound;
import net.minecraft.client.audio.SoundHandler;
public class Sounds {
private static SoundHandler soundMgr;
public static void addSoundTile(SoundTile soundTile) {
addSound(new TickableSoundTile(soundTile));
}
public static void addSound(ISound sound) {
if (canAddSound(sound)) {
soundMgr.playSound(sound);
}
}
public static boolean canAddSound(ISound sound) {
if (soundMgr == null) {
soundMgr = Minecraft.getMinecraft().getSoundHandler();
}
return !soundMgr.isSoundPlaying(sound);
}
}