Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package skywars.notjacob.runnables;
- import org.bukkit.scheduler.BukkitRunnable;
- import skywars.notjacob.main.SkyWars;
- public class GameTimerR {
- private SkyWars plugin;
- public void timer() {
- new BukkitRunnable() {
- int timer = 10 * 60 * 20;
- //12,000 total || 0 game end || 2400 dragons || 4800 refill || 7200 refill || 9600 refill || 12000 game start
- @Override
- public void run() {
- if (timer > 9600) {
- timer--;
- } else if (timer == 9600){
- //refill
- timer--;
- } else if (timer > 7200) {
- timer--;
- } else if (timer == 7200) {
- //refill
- timer--;
- } else if (timer > 4800) {
- timer--;
- } else if (timer == 4800) {
- //refill
- timer--;
- } else if (timer > 2400) {
- //dragons
- timer--;
- } else if (timer > 0) {
- timer--;
- } else {
- cancel();
- //end
- }
- }
- }.runTaskTimerAsynchronously(plugin, 0L, 20L);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement