mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-04 11:36:24 +00:00
globalgroups prefix 'g:' is now not case sensitive.
This commit is contained in:
parent
263a3fc80b
commit
1838dbc931
2 changed files with 9 additions and 9 deletions
|
@ -294,7 +294,7 @@ public class GlobalGroups {
|
||||||
*/
|
*/
|
||||||
public boolean hasPermission(String groupName, String permissionNode) {
|
public boolean hasPermission(String groupName, String permissionNode) {
|
||||||
|
|
||||||
if (!hasGroup(groupName.toLowerCase()))
|
if (!hasGroup(groupName))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return groups.get(groupName.toLowerCase()).hasSamePermissionNode(permissionNode);
|
return groups.get(groupName.toLowerCase()).hasSamePermissionNode(permissionNode);
|
||||||
|
@ -315,7 +315,7 @@ public class GlobalGroups {
|
||||||
result.askedPermission = permissionNode;
|
result.askedPermission = permissionNode;
|
||||||
result.resultType = PermissionCheckResult.Type.NOTFOUND;
|
result.resultType = PermissionCheckResult.Type.NOTFOUND;
|
||||||
|
|
||||||
if (!hasGroup(groupName.toLowerCase()))
|
if (!hasGroup(groupName))
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
Group tempGroup = groups.get(groupName.toLowerCase());
|
Group tempGroup = groups.get(groupName.toLowerCase());
|
||||||
|
@ -337,7 +337,7 @@ public class GlobalGroups {
|
||||||
* @return List of all group names
|
* @return List of all group names
|
||||||
*/
|
*/
|
||||||
public List<String> getGroupsPermissions(String groupName) {
|
public List<String> getGroupsPermissions(String groupName) {
|
||||||
if (!hasGroup(groupName.toLowerCase()))
|
if (!hasGroup(groupName))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return groups.get(groupName.toLowerCase()).getPermissionList();
|
return groups.get(groupName.toLowerCase()).getPermissionList();
|
||||||
|
@ -374,7 +374,7 @@ public class GlobalGroups {
|
||||||
* @return Group object
|
* @return Group object
|
||||||
*/
|
*/
|
||||||
public Group getGroup(String groupName) {
|
public Group getGroup(String groupName) {
|
||||||
if (!hasGroup(groupName.toLowerCase()))
|
if (!hasGroup(groupName))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return groups.get(groupName.toLowerCase());
|
return groups.get(groupName.toLowerCase());
|
||||||
|
|
|
@ -195,7 +195,7 @@ public class WorldDataHolder {
|
||||||
* @return a group if it is found. null if not found.
|
* @return a group if it is found. null if not found.
|
||||||
*/
|
*/
|
||||||
public Group getGroup(String groupName) {
|
public Group getGroup(String groupName) {
|
||||||
if (groupName.startsWith("g:"))
|
if (groupName.toLowerCase().startsWith("g:"))
|
||||||
return GroupManager.getGlobalGroups().getGroup(groupName);
|
return GroupManager.getGlobalGroups().getGroup(groupName);
|
||||||
else
|
else
|
||||||
return groups.get(groupName.toLowerCase());
|
return groups.get(groupName.toLowerCase());
|
||||||
|
@ -208,7 +208,7 @@ public class WorldDataHolder {
|
||||||
* @return true if exists. false if not.
|
* @return true if exists. false if not.
|
||||||
*/
|
*/
|
||||||
public boolean groupExists(String groupName) {
|
public boolean groupExists(String groupName) {
|
||||||
if (groupName.startsWith("g:"))
|
if (groupName.toLowerCase().startsWith("g:"))
|
||||||
return GroupManager.getGlobalGroups().hasGroup(groupName);
|
return GroupManager.getGlobalGroups().hasGroup(groupName);
|
||||||
else
|
else
|
||||||
return groups.containsKey(groupName.toLowerCase());
|
return groups.containsKey(groupName.toLowerCase());
|
||||||
|
@ -219,7 +219,7 @@ public class WorldDataHolder {
|
||||||
* @param groupToAdd
|
* @param groupToAdd
|
||||||
*/
|
*/
|
||||||
public void addGroup(Group groupToAdd) {
|
public void addGroup(Group groupToAdd) {
|
||||||
if (groupToAdd.getName().startsWith("g:")) {
|
if (groupToAdd.getName().toLowerCase().startsWith("g:")) {
|
||||||
GroupManager.getGlobalGroups().addGroup(groupToAdd);
|
GroupManager.getGlobalGroups().addGroup(groupToAdd);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -238,7 +238,7 @@ public class WorldDataHolder {
|
||||||
* @return true if had something to remove. false the group was default or non-existant
|
* @return true if had something to remove. false the group was default or non-existant
|
||||||
*/
|
*/
|
||||||
public boolean removeGroup(String groupName) {
|
public boolean removeGroup(String groupName) {
|
||||||
if (groupName.startsWith("g:")) {
|
if (groupName.toLowerCase().startsWith("g:")) {
|
||||||
return GroupManager.getGlobalGroups().removeGroup(groupName);
|
return GroupManager.getGlobalGroups().removeGroup(groupName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,7 +278,7 @@ public class WorldDataHolder {
|
||||||
* @return null if group already exists. or new Group
|
* @return null if group already exists. or new Group
|
||||||
*/
|
*/
|
||||||
public Group createGroup(String groupName) {
|
public Group createGroup(String groupName) {
|
||||||
if (groupName.startsWith("g:")) {
|
if (groupName.toLowerCase().startsWith("g:")) {
|
||||||
Group newGroup = new Group(groupName);
|
Group newGroup = new Group(groupName);
|
||||||
return GroupManager.getGlobalGroups().newGroup(newGroup);
|
return GroupManager.getGlobalGroups().newGroup(newGroup);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue