HugoZvPlayZ

KOD

Apr 18th, 2014
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.60 KB | None | 0 0
  1.     HashMap<String, Long> czas = new HashMap<String, Long>();
  2.     public void startArena(final String arena){
  3.         czas.put(arena, System.currentTimeMillis() + 60 * 1000);
  4.         Bukkit.getScheduler().runTaskTimer(main, new Runnable(){
  5.             @Override
  6.             public void run(){
  7.                 for(World world : Bukkit.getWorlds()){
  8.                     if (czas.containsKey(arena)){
  9.                         if (czas.get(arena) <= System.currentTimeMillis()){
  10.                             Bukkit.broadcastMessage("Gra rozpocznie sie za " + (czas.get(arena) - System.currentTimeMillis()) / 1000);
  11.                         }
  12.                         else{
  13.                             czas.remove(arena);
  14.                         }
  15.                     }
  16.                 }
  17.             }
  18.         }, 20, 20);
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment