Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. public class SotwTask extends BukkitRunnable {
  2.  
  3. private int time;
  4. private int chatInterval;
  5.  
  6. public SotwTask(int time, int chatInterval) {
  7. this.time = time;
  8. this.chatInterval = chatInterval;
  9. }
  10.  
  11. @Override
  12. public void run() {
  13. if(time > 0) {
  14. if(paused) return;
  15.  
  16. if(!ConfigHandler.sotw_timer_on_scoreboard) {
  17. if(time % chatInterval == 0) {
  18. sendSotwChatMessage();
  19. }
  20. }
  21. time--;
  22.  
  23. } else {
  24. this.cancel();
  25. sotwTask = null;
  26.  
  27. Message.sendMessage(Lng.PREFIX.toString() + Lng.SOTW_ENDED.toString());
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement