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

54 lines
1.8 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) {
SoundManager SM = SpoutManager.getSoundManager();
SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
SM.playSoundEffect(sPlayer, effect, location);
}
/**
* Play noise on successful repair.
*
* @param player The player who repaired an item
*/
public static void playRepairNoise(Player player, McMMO plugin) {
2012-03-21 03:33:58 +01:00
SoundManager SM = SpoutManager.getSoundManager();
SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
//If this is pulling from online, why have it in the jar?
2012-04-21 00:09:50 +02:00
SM.playCustomSoundEffect(plugin, sPlayer, "repair.wav", false);
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-03-21 03:33:58 +01:00
SoundManager SM = SpoutManager.getSoundManager();
SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
//If this is pulling from online, why have it in the jar?
2012-04-21 00:09:50 +02:00
SM.playCustomSoundEffect(plugin, sPlayer, "level.wav", false);
2012-03-21 03:33:58 +01:00
}
}