Esempio n. 1
0
  public void createDuel(Player p1, Player p2, String mode) {
    Duel duel = new Duel(this.plugin, p1.getName(), p2.getName(), mode);

    this.invites.removeAll(p1.getName());
    this.invites.removeAll(p2.getName());

    p1.getInventory().clear();
    p2.getInventory().clear();

    p1.updateInventory();
    p2.updateInventory();

    p1.setHealth(20.0D);
    p2.setHealth(20.0D);

    this.duels.add(duel);
    duel.setTaskID(Bukkit.getScheduler().scheduleSyncRepeatingTask(this.plugin, duel, 0L, 10L));
    for (String s : ovo) {
      Player p = Bukkit.getPlayerExact(s);
      if ((!p.getName().equals(p1.getName())) && (!p.getName().equals(p2.getName()))) {
        p1.hidePlayer(p);
        p2.hidePlayer(p);
      }
    }
  }
Esempio n. 2
0
  public void enter(Player p1) {
    if (p1.getVehicle() == null) {
      p1.sendMessage(ChatColor.YELLOW + "Vous �tes entr� dans le training !");

      this.plugin.clearPlayer(p1);
      p1.getInventory().setItem(0, GameListener.soup);
      p1.getInventory().setHeldItemSlot(0);
      p1.getInventory().setItem(1, GameListener.vanilla1);
      p1.getInventory().setItem(2, GameListener.vanilla2);

      /** BLASTFIGHT ADD */
      p1.getInventory().setItem(4, GameListener.cheat);
      p1.getInventory().setItem(6, GameListener.soup2);
      p1.getInventory().setItem(7, GameListener.vanilla3);
      p1.getInventory().setItem(8, GameListener.vanilla4);
      p1.getInventory().setItem(3, GameListener.ranked);
      p1.getInventory().setItem(5, GameListener.rankedcheat);

      /** BLASTFIGHT ADD END */
      p1.teleport(this.plugin.getArena());
      p1.setHealth(20.0D);
      p1.setFoodLevel(20);

      ovo.add(p1.getName());

      Iterator<Duel> it = this.duels.iterator();
      while (it.hasNext()) {
        Duel d = (Duel) it.next();
        d.getPlayer1().hidePlayer(p1);
        d.getPlayer2().hidePlayer(p1);
      }
    } else {
      p1.sendMessage(
          ChatColor.RED
              + "Vous ne pouvez pas rejoindre en �tant sur un objets non identifi� "
              + p1.getVehicle().getType().toString().toLowerCase());
    }
  }