SpoutSounds.java 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package com.gmail.nossr50.spout;
  2. import org.bukkit.Location;
  3. import org.bukkit.entity.Player;
  4. import org.getspout.spoutapi.SpoutManager;
  5. import org.getspout.spoutapi.player.SpoutPlayer;
  6. import org.getspout.spoutapi.sound.SoundEffect;
  7. import org.getspout.spoutapi.sound.SoundManager;
  8. import com.gmail.nossr50.mcMMO;
  9. public class SpoutSounds {
  10. /**
  11. * Play sound effect through Spout.
  12. *
  13. * @param effect The sound effect to play
  14. * @param player The player to play the sound to
  15. * @param location The location the sound should come from
  16. */
  17. public static void playSoundForPlayer(SoundEffect effect, Player player, Location location) {
  18. SoundManager SM = SpoutManager.getSoundManager();
  19. SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
  20. SM.playSoundEffect(sPlayer, effect, location);
  21. }
  22. /**
  23. * Play noise on successful repair.
  24. *
  25. * @param player The player who repaired an item
  26. */
  27. public static void playRepairNoise(Player player, mcMMO plugin) {
  28. SoundManager SM = SpoutManager.getSoundManager();
  29. SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
  30. //If this is pulling from online, why have it in the jar?
  31. SM.playCustomSoundEffect(plugin, sPlayer, "repair.wav", false);
  32. }
  33. /**
  34. * Play noise on level-up.
  35. *
  36. * @param player The player who leveled up
  37. */
  38. protected static void playLevelUpNoise(Player player, mcMMO plugin) {
  39. SoundManager SM = SpoutManager.getSoundManager();
  40. SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
  41. //If this is pulling from online, why have it in the jar?
  42. SM.playCustomSoundEffect(plugin, sPlayer, "level.wav", false);
  43. }
  44. }