Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. public void gameStartTimer() {
  2. new BukkitRunnable() {
  3. public void run() {
  4. if (CURRENT_PLAYERS == MAX_PLAYERS) {
  5. for (int i = 30; i > -1; i--) {
  6. if (i == 30) {
  7. Bukkit.getServer().broadcastMessage(ChatColor.GRAY + "The game will start in 30 seconds");
  8. }
  9.  
  10. if (i == 15) {
  11. Bukkit.getServer().broadcastMessage(ChatColor.GRAY + "The game will start in 15 seconds");
  12. }
  13.  
  14. if (i >= 5) {
  15. Bukkit.getServer().broadcastMessage(ChatColor.GRAY + "The game will start in " + i + " seconds");
  16. }
  17.  
  18. if (i == 0) {
  19. Bukkit.getServer().broadcastMessage(ChatColor.GRAY + "The game is starting..");
  20. }
  21. }
  22. } else {
  23. this.cancel();
  24. }
  25. }
  26. }.runTaskTimer(this, 20, 20);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement