Advertisement
MathWeIIan

Task

Nov 9th, 2018
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1. public class GameTimeBeforePvP
  2. {  
  3.     int task;
  4.    
  5.     public GameTimeBeforePvP()
  6.     {
  7.         GameStates.setState(GameStates.PVP);
  8.         task = Bukkit.getScheduler().scheduleSyncRepeatingTask(Main.getInstance(), new Runnable()
  9.         {
  10.            
  11.             public void run()
  12.             {  
  13.                 Main.getInstance().getBoard().decrementCountdown();
  14.                 Main.getInstance().getBoard().updateScoreboard();
  15.                
  16.                 if(Main.getInstance().getBoard().getCountdown() == 0)
  17.                 {
  18.                     Bukkit.getScheduler().cancelTask(task);
  19.                     new GameTimeBeforeAssaut(); // The same class except the name and some messages I spared you, with same bug of course
  20.                 }
  21.             }
  22.            
  23.         }, 20, 20);
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement