Пример #1
0
  @Override
  public List<Player> getRecievers(PlayerList playerList) {
    List<Player> recieverList = new LinkedList<Player>();
    if (reciever.getName() != null) {
      Collections.addAll(recieverList, sender, reciever);
      reciever.setReply(sender);
    } else {
      recieverList.clear();
    }

    return recieverList;
  }
Пример #2
0
  @Override
  protected void executeWithTarget(Player player, String message, Player target) {
    target.teleportTo(player);

    player
        .getServer()
        .adminLog(
            "Admin "
                + player.getName()
                + " teleported:\t "
                + target.getName()
                + "\tto\t"
                + player.getName());
  }
Пример #3
0
 public void execute(Player player, String message) {
   String name = extractArgument(message);
   if (name == null) {
     player.setAttemptedAction(Action.Unlock);
     player.addMessage("\u00a77The next chest you open will get unlocked.");
   } else {
     List<Chest> chests = player.getServer().chests.getChestsByName(name);
     for (Chest chest : chests) {
       chest.unlock();
     }
     player.getServer().chests.save();
     if (chests.size() > 1) {
       player.addMessage("\u00a77" + chests.size() + " chests have been unlocked!");
     } else {
       player.addMessage("\u00a77The chest has been unlocked!");
     }
   }
 }
Пример #4
0
 @Override
 @Deprecated
 protected boolean sendToPlayer(Player reciever) {
   return (reciever.equals(this.reciever) || reciever.equals(sender));
 }
Пример #5
0
 public PrivateChat(Player sender, Player reciever) {
   super(sender);
   this.reciever = reciever;
   chatRoom = reciever.getName();
 }