Advertisement
notjacob

game timer

Jan 4th, 2020
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.93 KB | None | 0 0
  1. package skywars.notjacob.runnables;
  2.  
  3. import org.bukkit.scheduler.BukkitRunnable;
  4.  
  5. import skywars.notjacob.main.SkyWars;
  6.  
  7. public class GameTimerR {
  8.     private SkyWars plugin;
  9.     public void timer() {
  10.         new BukkitRunnable() {
  11.             int timer = 10 * 60 * 20;
  12.             //12,000 total || 0  game end || 2400 dragons || 4800 refill || 7200 refill || 9600 refill || 12000 game start
  13.             @Override
  14.             public void run() {
  15.                 if (timer > 9600) {
  16.                     timer--;
  17.                 } else if (timer == 9600){
  18.                     //refill
  19.                     timer--;
  20.                 } else if (timer > 7200) {
  21.                     timer--;
  22.                 } else if (timer == 7200) {
  23.                     //refill
  24.                     timer--;
  25.                 } else if (timer > 4800) {
  26.                     timer--;
  27.                 } else if (timer == 4800) {
  28.                     //refill
  29.                     timer--;
  30.                 } else if (timer > 2400) {
  31.                     //dragons
  32.                     timer--;
  33.                 } else if (timer > 0) {
  34.                     timer--;
  35.                 } else {
  36.                     cancel();
  37.                     //end
  38.                 }
  39.             }
  40.         }.runTaskTimerAsynchronously(plugin, 0L, 20L);
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement