Guest User

Untitled

a guest
May 22nd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. package server.model.players.sounds;
  2.  
  3. import server.model.players.Client;
  4.  
  5. /**
  6. * @author Pakku
  7. */
  8.  
  9. public class SoundHandler {
  10.  
  11. private Client c;
  12.  
  13. public SoundHandler(Client c) {
  14. this.c = c;
  15. }
  16.  
  17. public void playSound(int sound, int delay) {
  18. if(c.getOutStream() != null && c != null ) {
  19. c.outStream.createFrame(174);
  20. c.outStream.writeWord(sound);
  21. c.outStream.writeByte(c.soundVolume);
  22. c.outStream.writeWord(delay);
  23. c.updateRequired = true;
  24. c.appearanceUpdateRequired = true;
  25. }
  26. }
  27.  
  28. public void playSound(int sound) {
  29. if(c.getOutStream() != null && c != null ) {
  30. c.outStream.createFrame(174);
  31. c.outStream.writeWord(sound);
  32. c.outStream.writeByte(c.soundVolume);
  33. c.outStream.writeWord(0);
  34. c.updateRequired = true;
  35. c.appearanceUpdateRequired = true;
  36. }
  37. }
  38. }
Add Comment
Please, Sign In to add comment