mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-23 08:31:28 +01:00
Merge branch 'groupmanager' of github.com:essentials/Essentials into 2.9
This commit is contained in:
commit
afccda6350
@ -200,3 +200,4 @@ v 2.0:
|
|||||||
- Fix Synchronization on adding subgroups (thanks snowleo).
|
- Fix Synchronization on adding subgroups (thanks snowleo).
|
||||||
- Remove info node support from GlobalGroups. It should not have them as GlobalGroups are only permission collections.
|
- Remove info node support from GlobalGroups. It should not have them as GlobalGroups are only permission collections.
|
||||||
- Change order of data in Users.yml to [name, Group, SubGroup, Permissions, Info nodes].
|
- Change order of data in Users.yml to [name, Group, SubGroup, Permissions, Info nodes].
|
||||||
|
- Add alphabetically sorted user lists.
|
@ -15,8 +15,10 @@ import java.util.ArrayList;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.TreeSet;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import org.anjocaido.groupmanager.GroupManager;
|
import org.anjocaido.groupmanager.GroupManager;
|
||||||
@ -1018,17 +1020,19 @@ public class WorldDataHolder {
|
|||||||
public static void writeUsers(WorldDataHolder ph, File usersFile) {
|
public static void writeUsers(WorldDataHolder ph, File usersFile) {
|
||||||
|
|
||||||
Map<String, Object> root = new HashMap<String, Object>();
|
Map<String, Object> root = new HashMap<String, Object>();
|
||||||
|
LinkedHashMap<String, Object> usersMap = new LinkedHashMap<String, Object>();
|
||||||
|
|
||||||
Map<String, Object> usersMap = new HashMap<String, Object>();
|
|
||||||
root.put("users", usersMap);
|
root.put("users", usersMap);
|
||||||
synchronized (ph.getUsers()) {
|
synchronized (ph.getUsers()) {
|
||||||
for (String userKey : ph.getUsers().keySet()) {
|
|
||||||
|
// A sorted list of users.
|
||||||
|
for (String userKey : new TreeSet<String>(ph.getUsers().keySet())) {
|
||||||
User user = ph.getUsers().get(userKey);
|
User user = ph.getUsers().get(userKey);
|
||||||
if ((user.getGroup() == null || user.getGroup().equals(ph.getDefaultGroup())) && user.getPermissionList().isEmpty() && user.getVariables().isEmpty() && user.isSubGroupsEmpty()) {
|
if ((user.getGroup() == null || user.getGroup().equals(ph.getDefaultGroup())) && user.getPermissionList().isEmpty() && user.getVariables().isEmpty() && user.isSubGroupsEmpty()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Object> aUserMap = new HashMap<String, Object>();
|
LinkedHashMap<String, Object> aUserMap = new LinkedHashMap<String, Object>();
|
||||||
usersMap.put(user.getName(), aUserMap);
|
usersMap.put(user.getName(), aUserMap);
|
||||||
|
|
||||||
// GROUP NODE
|
// GROUP NODE
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
# "For a more advanced configuration example utilizing the advanced features of GroupManager, see http://pastebin.com/a8ZA0j5G"
|
# "For a more advanced configuration example utilizing the advanced features of GroupManager, see http://pastebin.com/a8ZA0j5G"
|
||||||
users:
|
users:
|
||||||
snowleo:
|
snowleo:
|
||||||
subgroups: []
|
|
||||||
permissions: []
|
|
||||||
group: Builder
|
group: Builder
|
||||||
|
subgroups: []
|
||||||
|
permissions: []
|
||||||
KHobbits:
|
KHobbits:
|
||||||
|
group: Moderator
|
||||||
subgroups: []
|
subgroups: []
|
||||||
permissions: []
|
permissions: []
|
||||||
group: Moderator
|
|
||||||
ElgarL:
|
ElgarL:
|
||||||
|
group: Moderator
|
||||||
subgroups: []
|
subgroups: []
|
||||||
permissions: []
|
permissions: []
|
||||||
group: Moderator
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user