Пример #1
0
  public void run() {
    if (gm.isBomb()) {
      int timer = gm.getBombTimer();

      if (timer != 0) {
        timer--;
        gm.setLobbyTimer(timer);

        for (Player p : gm.getArenaPlayers()) {
          p.setLevel(timer);
        }
      } else {
        gm.removePlayer(gm.getPotatoCarrier());

        for (Player p : gm.getArenaPlayers()) {
          p.setLevel(0);
          p.setExp(0);
          p.playSound(p.getLocation(), Sound.LEVEL_UP, 1, 10);
        }

        plugin.getServer().getScheduler().cancelTask(gm.getBomb());
        gm.setBombTimer(-1);
      }
    }
  }
Пример #2
0
  @Override
  public void runCommand(CommandSender sender, String[] args) {
    String maps = "";
    for (GameManager gameManager : HotPotato.getGames()) {
      String key =
          MessageUtil.getText(
              "gameListGame",
              gameManager.getGameName(),
              Integer.toString(gameManager.getGamePlayers().size()),
              Integer.toString(FileHandler.ConfigFile.getFile().getInt("maxPlayers")));
      maps = maps + ", " + key;
    }

    MessageUtil.sendTextMessage(sender, "gameList", maps.substring(2));
  }