Esempio n. 1
0
  /**
   * Transfer prisoner to specified jail. If player is online, he will be transfered instantly,
   * otherwise he will be transfered when he logs in.
   *
   * @param targetjail Name of the destination jail zone
   */
  public void transfer(String targetjail) {
    if (targetjail == null) targetjail = "find nearest";

    setTransferDestination(targetjail);
    Player player = Jail.instance.getServer().getPlayerExact(getName());

    if (player == null) {
      setOfflinePending(true);
      update();
      Jail.prisoners.put(getName(), this);
    } else {
      PrisonerManager.Transfer(this, player);
    }
  }
Esempio n. 2
0
  /**
   * Initiate transfer of every prisoner in specified jail zone to another jail zone
   *
   * @param target Name of the destination jail zone
   */
  public static void PrepareTransferAll(JailZone zone, String target) {
    for (JailPrisoner prisoner : zone.getPrisoners()) {
      prisoner.setTransferDestination(target);
      Player player = Jail.instance.getServer().getPlayerExact(prisoner.getName());
      if (player == null) {

        prisoner.setOfflinePending(true);
        InputOutput.UpdatePrisoner(prisoner);
        Jail.prisoners.put(prisoner.getName(), prisoner);

      } else {
        Transfer(prisoner, player);
      }
    }
  }