summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2011-12-08 04:44:34 +0000
committerKHobbits <rob@khobbits.co.uk>2011-12-08 04:44:34 +0000
commit52b1017bdaf31acc01dfcb3ff15b19c5e1f6ea62 (patch)
treed6226d52cb6dd8bed70f9ac6dffce7d38a0f09d4
parentb102c5f3d83d1959321197565817f2b49636f4da (diff)
parente379ac5d777cff442dcf8eb64ac391565cf1ecb6 (diff)
downloadEssentials-52b1017bdaf31acc01dfcb3ff15b19c5e1f6ea62.tar
Essentials-52b1017bdaf31acc01dfcb3ff15b19c5e1f6ea62.tar.gz
Essentials-52b1017bdaf31acc01dfcb3ff15b19c5e1f6ea62.tar.lz
Essentials-52b1017bdaf31acc01dfcb3ff15b19c5e1f6ea62.tar.xz
Essentials-52b1017bdaf31acc01dfcb3ff15b19c5e1f6ea62.zip
Merge branch 'master' of github.com:essentials/Essentials
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java9
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Variables.java8
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java20
3 files changed, 17 insertions, 20 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java
index eea488ab2..10757475d 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java
@@ -76,7 +76,7 @@ public class User extends DataUnit implements Cloneable {
for (String perm : this.getPermissionList()) {
clone.addPermission(perm);
}
- // clone.variables = this.variables.clone();
+ clone.variables = this.variables.clone(this);
clone.flagAsChanged();
return clone;
}
@@ -213,10 +213,11 @@ public class User extends DataUnit implements Cloneable {
* @param varList
*/
public void setVariables(Map<String, Object> varList) {
- UserVariables temp = new UserVariables(this, varList);
+ //UserVariables temp = new UserVariables(this, varList);
variables.clearVars();
- for (String key : temp.getVarKeyList()) {
- variables.addVar(key, temp.getVarObject(key));
+ for (String key : varList.keySet()) {
+ System.out.print("Adding variable - " + key);
+ variables.addVar(key, varList.get(key));
}
flagAsChanged();
if (GroupManager.isLoaded())
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Variables.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Variables.java
index e97b01a48..140d6626a 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Variables.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Variables.java
@@ -108,8 +108,6 @@ public abstract class Variables implements Cloneable {
return o == null ? -1.0D : Double.parseDouble(o.toString());
} catch (Exception e) {
return -1.0D;
-
-
}
}
@@ -119,8 +117,6 @@ public abstract class Variables implements Cloneable {
*/
public Set<String> getVarKeyList() {
return variables.keySet();
-
-
}
/**
@@ -130,8 +126,6 @@ public abstract class Variables implements Cloneable {
*/
public boolean hasVar(String name) {
return variables.containsKey(name);
-
-
}
/**
@@ -140,8 +134,6 @@ public abstract class Variables implements Cloneable {
*/
public int getSize() {
return variables.size();
-
-
}
/**
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java
index 2b6a80da6..4ef77687a 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java
@@ -631,7 +631,6 @@ public class WorldDataHolder {
} else
throw new IllegalArgumentException("Unknown entry found in Info section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath());
-
//END INFO NODE
if (thisGroupNode.get("inheritance") == null || thisGroupNode.get("inheritance") instanceof List) {
@@ -753,14 +752,19 @@ public class WorldDataHolder {
}
- //USER INFO NODE - BETA
-
+ //USER INFO NODE
+
//INFO NODE
- Map<String, Object> infoNode = (Map<String, Object>) thisUserNode.get("info");
- if (infoNode != null) {
- thisUser.setVariables(infoNode);
- }
- //END INFO NODE - BETA
+ if (thisUserNode.get("info") instanceof Map) {
+ Map<String, Object> infoNode = (Map<String, Object>) thisUserNode.get("info");
+ if (infoNode != null) {
+ thisUser.setVariables(infoNode);
+ }
+ } else if (thisUserNode.get("info") != null)
+ throw new IllegalArgumentException("Unknown entry found in Info section for user: " + thisUser.getName() + " in file: " + usersFile.getPath());
+
+ //END INFO NODE
+
if (thisUserNode.get("group") != null) {
Group hisGroup = ph.getGroup(thisUserNode.get("group").toString());