mcMMO/src/main/java/com/gmail/nossr50/spout/SpoutSounds.java

41 lines
1.4 KiB
Java
Raw Normal View History

2012-03-21 03:33:58 +01:00
package com.gmail.nossr50.spout;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.getspout.spoutapi.SpoutManager;
import org.getspout.spoutapi.player.SpoutPlayer;
import org.getspout.spoutapi.sound.SoundEffect;
import org.getspout.spoutapi.sound.SoundManager;
import com.gmail.nossr50.mcMMO;
2012-04-21 00:09:50 +02:00
2012-03-21 03:33:58 +01:00
public class SpoutSounds {
/**
* Play sound effect through Spout.
*
* @param effect The sound effect to play
* @param player The player to play the sound to
* @param location The location the sound should come from
*/
public static void playSoundForPlayer(SoundEffect effect, Player player, Location location) {
2012-07-03 16:14:01 +02:00
SoundManager soundManager = SpoutManager.getSoundManager();
SpoutPlayer spoutPlayer = SpoutManager.getPlayer(player);
2012-03-21 03:33:58 +01:00
2012-07-03 16:14:01 +02:00
soundManager.playSoundEffect(spoutPlayer, effect, location);
2012-03-21 03:33:58 +01:00
}
/**
* Play noise on level-up.
*
* @param player The player who leveled up
*/
protected static void playLevelUpNoise(Player player, mcMMO plugin) {
2012-07-03 16:14:01 +02:00
SoundManager soundManager = SpoutManager.getSoundManager();
SpoutPlayer spoutPlayer = SpoutManager.getPlayer(player);
2012-03-21 03:33:58 +01:00
//If this is pulling from online, why have it in the jar?
2012-07-03 16:14:01 +02:00
soundManager.playCustomSoundEffect(plugin, spoutPlayer, "level.wav", false);
2012-03-21 03:33:58 +01:00
}
}