Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1. private void start() {
  2.         _running = true;
  3.         _p1.openInventory(Inv);
  4.         _p2.openInventory(Inv);
  5.         new BukkitRunnable() {
  6.             private int counter = 5;
  7.  
  8.             @Override
  9.             public void run() {
  10.                 if (counter > 0 && _running) {
  11.                     int c = counter--;
  12.                     me.itzwam.shifumi.utils.Inventory.update(_p1, "Il reste " + c + "secondes");
  13.                     me.itzwam.shifumi.utils.Inventory.update(_p2, "Il reste " + c + "secondes");
  14.                 } else {
  15.                     if (_running) end();
  16.                     _p1.closeInventory();
  17.                     _p2.closeInventory();
  18.                     this.cancel();
  19.                 }
  20.             }
  21.  
  22.         }.runTaskTimer(Main.instance, 20, 20);
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement