Guest User

Untitled

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