mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-09-30 00:27:26 +02:00
Merge branch 'groupmanager' of github.com:essentials/Essentials into 2.9
Resolved Conflicts: EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java
This commit is contained in:
commit
5cc24827fc
@ -197,3 +197,5 @@ v 2.0:
|
|||||||
- No more null errors from corrupt config.yml's.
|
- No more null errors from corrupt config.yml's.
|
||||||
- Give a better error when a subgroup is null.
|
- Give a better error when a subgroup is null.
|
||||||
- Include the GM version when logging errors.
|
- Include the GM version when logging errors.
|
||||||
|
- Fix Synchronization on adding subgroups (thanks snowleo).
|
||||||
|
- Remove info node support from GlobalGroups. It should not have them as GlobalGroups are only permission collections.
|
@ -1,6 +1,8 @@
|
|||||||
# These groups only contain permission nodes.
|
# These groups only contain permission nodes.
|
||||||
#
|
#
|
||||||
# **** You can NOT add anything other than permission nodes ****
|
# **** You can NOT add anything other than permission nodes ****
|
||||||
|
# **** This is NOT where you set up the groups which you give to users! ****
|
||||||
|
# **** goto groupmanager/worlds/worldname/groups.yml if you want to set the actual groups! ****
|
||||||
#
|
#
|
||||||
# These collections are to be inherited in your different worlds groups.yml's
|
# These collections are to be inherited in your different worlds groups.yml's
|
||||||
# They can also be added as one of a users subgroups, but NOT as a primary group.
|
# They can also be added as one of a users subgroups, but NOT as a primary group.
|
||||||
|
@ -19,7 +19,6 @@ import org.anjocaido.groupmanager.events.GMGroupEvent;
|
|||||||
import org.anjocaido.groupmanager.events.GroupManagerEventHandler;
|
import org.anjocaido.groupmanager.events.GroupManagerEventHandler;
|
||||||
import org.anjocaido.groupmanager.utils.PermissionCheckResult;
|
import org.anjocaido.groupmanager.utils.PermissionCheckResult;
|
||||||
import org.anjocaido.groupmanager.utils.Tasks;
|
import org.anjocaido.groupmanager.utils.Tasks;
|
||||||
import org.bukkit.configuration.MemorySection;
|
|
||||||
import org.yaml.snakeyaml.DumperOptions;
|
import org.yaml.snakeyaml.DumperOptions;
|
||||||
import org.yaml.snakeyaml.Yaml;
|
import org.yaml.snakeyaml.Yaml;
|
||||||
import org.yaml.snakeyaml.constructor.SafeConstructor;
|
import org.yaml.snakeyaml.constructor.SafeConstructor;
|
||||||
@ -184,22 +183,22 @@ public class GlobalGroups {
|
|||||||
} else
|
} else
|
||||||
throw new IllegalArgumentException("Unknown type of permission node for global group: " + groupName);
|
throw new IllegalArgumentException("Unknown type of permission node for global group: " + groupName);
|
||||||
|
|
||||||
// Info nodes
|
// // Info nodes
|
||||||
try {
|
// try {
|
||||||
element = ((Map<String, Object>)allGroups.get(groupName)).get("info");
|
// element = ((Map<String, Object>)allGroups.get(groupName)).get("info");
|
||||||
} catch ( Exception ex) {
|
// } catch ( Exception ex) {
|
||||||
throw new IllegalArgumentException("The GlobalGroup ' " + groupName + "' is formatted incorrectly: ", ex);
|
// throw new IllegalArgumentException("The GlobalGroup ' " + groupName + "' is formatted incorrectly: ", ex);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (element != null)
|
// if (element != null)
|
||||||
if (element instanceof MemorySection) {
|
// if (element instanceof MemorySection) {
|
||||||
Map<String, Object> vars = new HashMap<String, Object>();
|
// Map<String, Object> vars = new HashMap<String, Object>();
|
||||||
for (String key : ((MemorySection) element).getKeys(false)) {
|
// for (String key : ((MemorySection) element).getKeys(false)) {
|
||||||
vars.put(key, ((MemorySection) element).get(key));
|
// vars.put(key, ((MemorySection) element).get(key));
|
||||||
}
|
// }
|
||||||
newGroup.setVariables(vars);
|
// newGroup.setVariables(vars);
|
||||||
} else
|
// } else
|
||||||
throw new IllegalArgumentException("Unknown type of info node for global group: " + groupName);
|
// throw new IllegalArgumentException("Unknown type of info node for global group: " + groupName);
|
||||||
|
|
||||||
// Push a new group
|
// Push a new group
|
||||||
addGroup(newGroup);
|
addGroup(newGroup);
|
||||||
@ -236,6 +235,14 @@ public class GlobalGroups {
|
|||||||
Map<String, Object> aGroupMap = new HashMap<String, Object>();
|
Map<String, Object> aGroupMap = new HashMap<String, Object>();
|
||||||
groupsMap.put(group.getName(), aGroupMap);
|
groupsMap.put(group.getName(), aGroupMap);
|
||||||
|
|
||||||
|
// // Info nodes
|
||||||
|
// Map<String, Object> infoMap = new HashMap<String, Object>();
|
||||||
|
// aGroupMap.put("info", infoMap);
|
||||||
|
//
|
||||||
|
// for (String infoKey : group.getVariables().getVarKeyList()) {
|
||||||
|
// infoMap.put(infoKey, group.getVariables().getVarObject(infoKey));
|
||||||
|
// }
|
||||||
|
|
||||||
// Permission nodes
|
// Permission nodes
|
||||||
aGroupMap.put("permissions", group.getPermissionList());
|
aGroupMap.put("permissions", group.getPermissionList());
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ public class User extends DataUnit implements Cloneable {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private String group = null;
|
private String group = null;
|
||||||
private final List<String> subGroups = Collections.synchronizedList(Collections.<String>emptyList());
|
private final List<String> subGroups = Collections.synchronizedList(new ArrayList<String>());
|
||||||
/**
|
/**
|
||||||
* This one holds the fields in INFO node. like prefix = 'c' or build =
|
* This one holds the fields in INFO node. like prefix = 'c' or build =
|
||||||
* false
|
* false
|
||||||
|
Loading…
Reference in New Issue
Block a user