Exemple #1
0
  /**
   * Use this to deliver a user from one WorldDataHolder to another
   *
   * @param dataSource
   * @return null if given dataSource already contains the same user
   */
  public User clone(WorldDataHolder dataSource) {

    if (dataSource.isUserDeclared(this.getName())) {
      return null;
    }
    User clone = dataSource.createUser(this.getName());
    if (dataSource.getGroup(group) == null) {
      clone.setGroup(dataSource.getDefaultGroup());
    } else {
      clone.setGroup(dataSource.getGroup(this.getGroupName()));
    }
    for (String perm : this.getPermissionList()) {
      clone.addPermission(perm);
    }
    clone.variables = this.variables.clone(this);
    clone.flagAsChanged();
    return clone;
  }
Exemple #2
0
  /** @param group the group to set */
  public void setGroup(Group group) {

    setGroup(group, true);
  }