mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-13 18:14:38 +02:00
Stop attempting to push empty permissions when players edit the yml's
incorrectly.
This commit is contained in:
@@ -154,4 +154,5 @@ v 1.9:
|
|||||||
- Don't remove an attachment on a player leaving as Bukkit never forgets it. This fixes non mirrored permissions being messed up if a player relogs.
|
- Don't remove an attachment on a player leaving as Bukkit never forgets it. This fixes non mirrored permissions being messed up if a player relogs.
|
||||||
- Treat all world names as lower case for file handling (please check in your worlds folder. You should have no folders with upper case letters from now).
|
- Treat all world names as lower case for file handling (please check in your worlds folder. You should have no folders with upper case letters from now).
|
||||||
- Auto rename all case sensitive world folders to lower case (if possible).
|
- Auto rename all case sensitive world folders to lower case (if possible).
|
||||||
- Update GlobalGroups.yml for new/changed Towny permission nodes.
|
- Update GlobalGroups.yml for new/changed Towny permission nodes.
|
||||||
|
- Stop attempting to push empty permissions when players edit the yml's incorrectly.
|
@@ -485,14 +485,22 @@ public class WorldDataHolder {
|
|||||||
if (thisGroupNode.get("permissions") instanceof List) {
|
if (thisGroupNode.get("permissions") instanceof List) {
|
||||||
for (Object o : ((List) thisGroupNode.get("permissions"))) {
|
for (Object o : ((List) thisGroupNode.get("permissions"))) {
|
||||||
try {
|
try {
|
||||||
thisGrp.addPermission(o.toString());
|
/*
|
||||||
|
* Only add this permission if it's not empty.
|
||||||
|
*/
|
||||||
|
if (!thisGroupNode.get("permissions").toString().isEmpty())
|
||||||
|
thisGrp.addPermission(o.toString());
|
||||||
} catch (NullPointerException e) {
|
} catch (NullPointerException e) {
|
||||||
// Ignore this entry as it's null.
|
// Ignore this entry as it's null.
|
||||||
//throw new IllegalArgumentException("Invalid permission node in group: " + thisGrp.getName() + " in file: " + groupsFile.getPath());
|
//throw new IllegalArgumentException("Invalid permission node in group: " + thisGrp.getName() + " in file: " + groupsFile.getPath());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (thisGroupNode.get("permissions") instanceof String) {
|
} else if (thisGroupNode.get("permissions") instanceof String) {
|
||||||
thisGrp.addPermission((String) thisGroupNode.get("permissions"));
|
/*
|
||||||
|
* Only add this permission if it's not empty.
|
||||||
|
*/
|
||||||
|
if (!thisGroupNode.get("permissions").toString().isEmpty())
|
||||||
|
thisGrp.addPermission((String) thisGroupNode.get("permissions"));
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException("Unknown type of permissions node(Should be String or List<String>) for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath());
|
throw new IllegalArgumentException("Unknown type of permissions node(Should be String or List<String>) for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath());
|
||||||
}
|
}
|
||||||
@@ -617,11 +625,19 @@ public class WorldDataHolder {
|
|||||||
} else {
|
} else {
|
||||||
if (thisUserNode.get("permissions") instanceof List) {
|
if (thisUserNode.get("permissions") instanceof List) {
|
||||||
for (Object o : ((List) thisUserNode.get("permissions"))) {
|
for (Object o : ((List) thisUserNode.get("permissions"))) {
|
||||||
thisUser.addPermission(o.toString());
|
/*
|
||||||
|
* Only add this permission if it's not empty
|
||||||
|
*/
|
||||||
|
if (!o.toString().isEmpty())
|
||||||
|
thisUser.addPermission(o.toString());
|
||||||
}
|
}
|
||||||
} else if (thisUserNode.get("permissions") instanceof String) {
|
} else if (thisUserNode.get("permissions") instanceof String) {
|
||||||
try {
|
try {
|
||||||
thisUser.addPermission(thisUserNode.get("permissions").toString());
|
/*
|
||||||
|
* Only add this permission if it's not empty
|
||||||
|
*/
|
||||||
|
if (!thisUserNode.get("permissions").toString().isEmpty())
|
||||||
|
thisUser.addPermission(thisUserNode.get("permissions").toString());
|
||||||
} catch (NullPointerException e) {
|
} catch (NullPointerException e) {
|
||||||
// Ignore this entry as it's null.
|
// Ignore this entry as it's null.
|
||||||
//throw new IllegalArgumentException("Invalid permission node for user: " + thisUser.getName() + " in file: " + UserFile.getPath());
|
//throw new IllegalArgumentException("Invalid permission node for user: " + thisUser.getName() + " in file: " + UserFile.getPath());
|
||||||
|
Reference in New Issue
Block a user