mrkirby153

Untitled

Mar 22nd, 2014
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.41 KB | None | 0 0
  1. // Creates the lobby
  2.  public static void loadLobby(Game game, Location origin) {
  3.         int index = findNextIndex();
  4.         Lobby lobby = new Lobby(game, index, origin);
  5.         lobby.loadLobby();
  6.         lobbyArrayList.add(lobby);
  7.         lobbies[index] = lobby;
  8.         System.out.println("Generated lobby with index " + index + " at: " + origin.getWorld().getName() + "," + origin.getBlockX() + "," + origin.getBlockY() + "," + origin.getBlockZ());
  9.     }
  10.  
  11. //--------------
  12. // Sets the sign contents
  13. for (int i = 0; i < signs.size(); i++) {
  14.             Block block = signs.get(i).getBlock();
  15.             if (!(block.getType() == Material.WALL_SIGN))
  16.                 continue;
  17.             Lobby lobby;
  18.             if (lobbies.size() > i)
  19.                 lobby = lobbies.get(i);
  20.             else
  21.                 continue;
  22.             Sign sign = (Sign) block.getState();
  23.             int playerCount = lobby.getPlayerCount();
  24.             if (lobby.isFull())
  25.                 sign.setLine(0, ChatColor.BOLD + "" + ChatColor.LIGHT_PURPLE + "[VIP]");
  26.             else
  27.                 sign.setLine(0, ChatColor.BOLD + "" + ChatColor.GREEN + "[Join]");
  28.             sign.setLine(1, Integer.toString(lobby.getIndex()));
  29.             sign.setLine(2, playerCount + "/" + lobby.game.getMaxPlayers());
  30.             sign.setLine(3, "");
  31.             sign.update();
  32.             usedLocations.add(block.getLocation());
  33.         }
Advertisement
Add Comment
Please, Sign In to add comment