summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java
diff options
context:
space:
mode:
authorElgarL <ElgarL@Palmergames.com>2014-04-14 23:40:04 +0100
committerElgarL <ElgarL@Palmergames.com>2014-04-14 23:40:04 +0100
commit50d3486d35f82415e35b8acd2f23cf594c5e2ae4 (patch)
treecc6ae2c43ae8831423389a5742b69e1b81abb992 /EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java
parent4f2ed6fe11c60763f1f3dad1e087c4db6e565be9 (diff)
downloadEssentials-50d3486d35f82415e35b8acd2f23cf594c5e2ae4.tar
Essentials-50d3486d35f82415e35b8acd2f23cf594c5e2ae4.tar.gz
Essentials-50d3486d35f82415e35b8acd2f23cf594c5e2ae4.tar.lz
Essentials-50d3486d35f82415e35b8acd2f23cf594c5e2ae4.tar.xz
Essentials-50d3486d35f82415e35b8acd2f23cf594c5e2ae4.zip
Fix overloadedWorldHolder so it correctly calls the new WorldHolder code when the user is not overloaded.
Diffstat (limited to 'EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java')
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java18
1 files changed, 8 insertions, 10 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java
index e6d11274f..38663ba7d 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java
@@ -69,10 +69,10 @@ public class User extends DataUnit implements Cloneable {
*/
public User clone(WorldDataHolder dataSource) {
- if (dataSource.isUserDeclared(this.getLastName())) {
+ if (dataSource.isUserDeclared(this.getUUID())) {
return null;
}
- User clone = dataSource.createUser(this.getLastName());
+ User clone = dataSource.createUser(this.getUUID());
if (dataSource.getGroup(group) == null) {
clone.setGroup(dataSource.getDefaultGroup());
} else {
@@ -86,17 +86,14 @@ public class User extends DataUnit implements Cloneable {
return clone;
}
- public User clone(String uUID) {
+ public User clone(String uUID, String CurrentName) {
User clone = this.getDataSource().createUser(uUID);
- if (this.getDataSource().getGroup(group) == null) {
- clone.setGroup(this.getDataSource().getDefaultGroup());
- } else {
- clone.setGroup(this.getDataSource().getGroup(this.getGroupName()));
- }
+ clone.setLastName(CurrentName);
- clone.setLastName(this.getLastName());
+ // Set the group silently.
+ clone.setGroup(this.getDataSource().getGroup(this.getGroupName()), false);
for (String perm : this.getPermissionList()) {
clone.addPermission(perm);
@@ -181,7 +178,8 @@ public class User extends DataUnit implements Cloneable {
if (notify)
GroupManager.notify(this.getLastName(), String.format(" moved to the group %s in %s.", group.getName(), this.getDataSource().getName()));
- GroupManager.getGMEventHandler().callEvent(this, Action.USER_GROUP_CHANGED);
+ if (updatePerms)
+ GroupManager.getGMEventHandler().callEvent(this, Action.USER_GROUP_CHANGED);
}
}