Advertisement
Guest User

Untitled

a guest
Jul 24th, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.47 KB | None | 0 0
  1.     public void update() {
  2.         //System.out.println(gameid);
  3.         if (msgqueue.size() > 0) {
  4.             display();
  5.             Bukkit.getScheduler().scheduleSyncDelayedTask(GameManager.getInstance().getPlugin(), new Runnable() {
  6.                 public void run() {
  7.                     display();
  8.                     update();
  9.                 }
  10.             }, 20L);
  11.             return;
  12.         }
  13.         clear();
  14.         Game game = GameManager.getInstance().getGame(gameid);
  15.         Sign s0 = signs.get(0);
  16.         //Sign s1 = signs.get(1);
  17.  
  18.        
  19.        
  20.         /* START EDITING TROLLKEMADA */
  21.        
  22.         /* añadido */
  23.        
  24.        
  25.        
  26.         s0.setLine(0, ChatColor.BOLD + "" + ChatColor.DARK_BLUE + "[Hg]");
  27.         s0.setLine(1, ChatColor.BOLD + "" + ChatColor.WHITE +"Arena"+gameid);
  28.         s0.setLine(2, ChatColor.BOLD + "" + ChatColor.WHITE + "" + game.getActivePlayers() + "/" + SettingsManager.getInstance().getSpawnCount(game.getID()));
  29.         String status = "";
  30.         switch (game.getMode()) {
  31.         case INGAME:
  32.         case FINISHING:
  33.         case RESETING:
  34.         case LOADING:
  35.             status = ChatColor.BOLD + "" + ChatColor.GOLD + "En partida";
  36.         case WAITING:
  37.             status = ChatColor.BOLD + "" + ChatColor.DARK_GREEN + "Disponible";
  38.             break;
  39.         case DISABLED:
  40.         case INACTIVE:
  41.         case ERROR:
  42.             status = ChatColor.BOLD + "" + ChatColor.RED + "Desactivada";
  43.             break;
  44.         case STARTING:
  45.             status = ChatColor.BOLD + "" + ChatColor.GOLD + "Empezando";
  46.             break;
  47.         }
  48.         s0.setLine(3, status);
  49.        
  50.         /* fin añadido */
  51.        
  52.         /* (eliminado)
  53.         //sign 0
  54.         s0.setLine(0, "[SurvivalGames]");
  55.         s0.setLine(1, "Click to join");
  56.         s0.setLine(2, "Arena " + gameid);
  57.        
  58.        
  59.  
  60.         //sign 1
  61.         s1.setLine(0, game.getName());
  62.         s1.setLine(1, game.getMode() + "");
  63.         s1.setLine(2, game.getActivePlayers() + "/" + ChatColor.GRAY + game.getInactivePlayers() + ChatColor.BLACK + "/" + SettingsManager.getInstance().getSpawnCount(game.getID()));
  64.  
  65.         //live update line s1
  66.         if (game.getMode() == Game.GameMode.STARTING) {
  67.             s1.setLine(3, game.getCountdownTime() + "");
  68.         } else if (game.getMode() == Game.GameMode.RESETING || game.getMode() == Game.GameMode.FINISHING) {
  69.             s1.setLine(3, game.getRBStatus());
  70.             if (game.getRBPercent() > 100) {
  71.                 s1.setLine(1, "Saving Queue");
  72.                 s1.setLine(3, (int) game.getRBPercent() + " left");
  73.             } else s1.setLine(3, (int) game.getRBPercent() + "%");
  74.         } else {
  75.             s1.setLine(3, "");
  76.         }
  77.  
  78.         //live player data
  79.         ArrayList < String > display = new ArrayList < String > ();
  80.         for (Player p: game.getAllPlayers()) {
  81.             display.add((game.isPlayerActive(p) ? ChatColor.BLACK : ChatColor.GRAY) + NameUtil.stylize(p.getName(), true, !game.isPlayerActive(p)));
  82.         }
  83.  
  84.         try {
  85.             int no = 2;
  86.             int line = 0;
  87.             for (String s: display) {
  88.                 signs.get(no).setLine(line, s);
  89.                 line++;
  90.                 if (line >= 4) {
  91.                     line = 0;
  92.                     no++;
  93.                 }
  94.             }
  95.         } catch (Exception e) {}
  96.        
  97.         */
  98.         /* END EDITING TROLLKEMADA */
  99.        
  100.         for (Sign s: signs) {
  101.             s.update();
  102.         }
  103.  
  104.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement