Ejemplo n.º 1
0
 private void performMatchAction(ArenaPlayer player) {
   BAExecutor executor = BattleArena.getBAExecutor();
   String args[];
   switch (command) {
     case JOIN:
       args = new String[] {"join", options1};
       executor.join(player, mp, args, true);
       break;
     case LEAVE:
       args = new String[] {"leave", options1, options2};
       executor.leave(player, mp, true);
       break;
     case START:
       break;
   }
 }
Ejemplo n.º 2
0
  public void testQueue() {
    MatchParams mp = loadParams("Arena");
    Player p1 = new TestBukkitPlayer("p1");
    Player p2 = new TestBukkitPlayer("p2");
    ArenaPlayer ap1 = BattleArena.toArenaPlayer(p1);
    ArenaPlayer ap2 = BattleArena.toArenaPlayer(p2);
    String[] args = new String[] {""};

    BAExecutor exec = new BAExecutor();
    exec.join(ap1, mp, args);
    exec.join(ap2, mp, args);
    for (MatchParams params : ParamController.getAllParams()) {
      System.out.println("param  =  " + params);
    }
    delay(50);
    assertTrue(bac.isInQue(ap1));
  }
Ejemplo n.º 3
0
  private static boolean changeSpawn(
      CommandSender sender,
      Arena arena,
      BattleArenaController ac,
      String changetype,
      String value,
      String[] otherOptions) {
    if (!BAExecutor.checkPlayer(sender)) return false;
    int locindex = verifySpawnLocation(sender, changetype);
    if (locindex == -1) return false;

    Player p = (Player) sender;
    Location loc = null;
    ac.removeArena(arena);
    loc = parseLocation(p, value);
    if (loc == null) {
      loc = p.getLocation();
    }
    arena.setSpawnLoc(locindex - 1, loc);
    ac.addArena(arena);
    sendMessage(
        sender, "&2team &6" + changetype + "&2 spawn set to location=&6" + Util.getLocString(loc));
    return true;
  }