mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 12:23:59 +00:00
Fix loading users with only numerals in their names to be seen as
strings.
This commit is contained in:
parent
656f25dc97
commit
51d61e7a91
2 changed files with 10 additions and 3 deletions
|
@ -185,3 +185,4 @@ v 2.0:
|
||||||
- Fix forgetting sub groups on a manload.
|
- Fix forgetting sub groups on a manload.
|
||||||
- Allow 'manucheckp' to notify when superperms reports false but it is really negated.
|
- Allow 'manucheckp' to notify when superperms reports false but it is really negated.
|
||||||
- Only output a Data update message if something has changed.
|
- Only output a Data update message if something has changed.
|
||||||
|
- Fix loading users with only numerals in their names to be seen as strings.
|
|
@ -775,20 +775,26 @@ public class WorldDataHolder {
|
||||||
|
|
||||||
Iterator<String> usersItr = allUsersNode.keySet().iterator();
|
Iterator<String> usersItr = allUsersNode.keySet().iterator();
|
||||||
String usersKey;
|
String usersKey;
|
||||||
|
Object node;
|
||||||
Integer userCount = 0;
|
Integer userCount = 0;
|
||||||
|
|
||||||
while (usersItr.hasNext()) {
|
while (usersItr.hasNext()) {
|
||||||
try {
|
try {
|
||||||
userCount++;
|
userCount++;
|
||||||
// Attempt to fetch the next user name.
|
// Attempt to fetch the next user name.
|
||||||
usersKey = usersItr.next();
|
node = usersItr.next();
|
||||||
|
if (node instanceof Integer)
|
||||||
|
usersKey = Integer.toString((Integer)node);
|
||||||
|
else
|
||||||
|
usersKey = node.toString();
|
||||||
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
throw new IllegalArgumentException("Invalid node type for user entry (" + userCount + ") in file: " + usersFile.getPath(), ex);
|
throw new IllegalArgumentException("Invalid node type for user entry (" + userCount + ") in file: " + usersFile.getPath(), ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Object> thisUserNode = null;
|
Map<String, Object> thisUserNode = null;
|
||||||
try {
|
try {
|
||||||
thisUserNode = (Map<String, Object>) allUsersNode.get(usersKey);
|
thisUserNode = (Map<String, Object>) allUsersNode.get(node);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
throw new IllegalArgumentException("Bad format found for user: " + usersKey + " in file: " + usersFile.getPath());
|
throw new IllegalArgumentException("Bad format found for user: " + usersKey + " in file: " + usersFile.getPath());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue