Package cofh.lib.util.helpers

Source Code of cofh.lib.util.helpers.SoundHelper

package cofh.lib.util.helpers;

import cofh.lib.audio.SoundBase;
import cpw.mods.fml.client.FMLClientHandler;

import net.minecraft.client.audio.ISound;
import net.minecraft.client.audio.SoundHandler;

/**
* Contains various helper functions to assist with Sound manipulation.
*
* @author King Lemming
*
*/
public class SoundHelper {

  public static final SoundHandler soundManager = FMLClientHandler.instance().getClient().getSoundHandler();

  /**
   * This allows you to have some tricky functionality with Tile Entities. Just be sure you aren't dumb.
   */
  public static void playSound(Object sound) {

    if (sound instanceof ISound) {
      soundManager.playSound((ISound) sound);
    }
  }

  public static void playSound(ISound sound) {

    soundManager.playSound(sound);
  }

  public static void playSound(String soundName, float x, float y, float z, float volume, float pitch) {

    soundManager.playSound(new SoundBase(soundName, volume, pitch, x, y, z));
  }

}
TOP

Related Classes of cofh.lib.util.helpers.SoundHelper

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.