mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-10-31 07:39:42 +01:00
Added return statement for setGroup method, updated it's JavaDocs
This commit is contained in:
parent
579c51f4a2
commit
7902cd87bb
@ -121,11 +121,15 @@ public class Utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method setGroup.
|
* Set the group of a player, by it's AuthMe group type.
|
||||||
* @param player Player
|
*
|
||||||
* @param group GroupType
|
* @param player The player.
|
||||||
|
* @param group The group type.
|
||||||
|
*
|
||||||
|
* @return True if succeed, false otherwise.
|
||||||
|
* False is also returned if groups aren't supported with the current permissions system.
|
||||||
*/
|
*/
|
||||||
public static void setGroup(Player player, GroupType group) {
|
public static boolean setGroup(Player player, GroupType group) {
|
||||||
if(!Settings.isPermissionCheckEnabled)
|
if(!Settings.isPermissionCheckEnabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -143,34 +147,33 @@ public class Utils {
|
|||||||
case UNREGISTERED:
|
case UNREGISTERED:
|
||||||
// Remove the other group type groups, set the current group
|
// Remove the other group type groups, set the current group
|
||||||
permsMan.removeGroups(player, Arrays.asList(Settings.getRegisteredGroup, Settings.getUnloggedinGroup));
|
permsMan.removeGroups(player, Arrays.asList(Settings.getRegisteredGroup, Settings.getUnloggedinGroup));
|
||||||
permsMan.addGroup(player, Settings.unRegisteredGroup);
|
return permsMan.addGroup(player, Settings.unRegisteredGroup);
|
||||||
break;
|
|
||||||
|
|
||||||
case REGISTERED:
|
case REGISTERED:
|
||||||
// Remove the other group type groups, set the current group
|
// Remove the other group type groups, set the current group
|
||||||
permsMan.removeGroups(player, Arrays.asList(Settings.unRegisteredGroup, Settings.getUnloggedinGroup));
|
permsMan.removeGroups(player, Arrays.asList(Settings.unRegisteredGroup, Settings.getUnloggedinGroup));
|
||||||
permsMan.addGroup(player, Settings.getRegisteredGroup);
|
return permsMan.addGroup(player, Settings.getRegisteredGroup);
|
||||||
break;
|
|
||||||
|
|
||||||
case NOTLOGGEDIN:
|
case NOTLOGGEDIN:
|
||||||
// Remove the other group type groups, set the current group
|
// Remove the other group type groups, set the current group
|
||||||
permsMan.removeGroups(player, Arrays.asList(Settings.unRegisteredGroup, Settings.getRegisteredGroup));
|
permsMan.removeGroups(player, Arrays.asList(Settings.unRegisteredGroup, Settings.getRegisteredGroup));
|
||||||
permsMan.addGroup(player, Settings.getUnloggedinGroup);
|
return permsMan.addGroup(player, Settings.getUnloggedinGroup);
|
||||||
break;
|
|
||||||
|
|
||||||
case LOGGEDIN:
|
case LOGGEDIN:
|
||||||
// Get the limbo player data
|
// Get the limbo player data
|
||||||
LimboPlayer limbo = LimboCache.getInstance().getLimboPlayer(player.getName().toLowerCase());
|
LimboPlayer limbo = LimboCache.getInstance().getLimboPlayer(player.getName().toLowerCase());
|
||||||
if(limbo == null)
|
if(limbo == null)
|
||||||
break;
|
return false;
|
||||||
|
|
||||||
// Get the players group
|
// Get the players group
|
||||||
String realGroup = limbo.getGroup();
|
String realGroup = limbo.getGroup();
|
||||||
|
|
||||||
// Remove the other group types groups, set the real group
|
// Remove the other group types groups, set the real group
|
||||||
permsMan.removeGroups(player, Arrays.asList(Settings.unRegisteredGroup, Settings.getRegisteredGroup, Settings.getUnloggedinGroup));
|
permsMan.removeGroups(player, Arrays.asList(Settings.unRegisteredGroup, Settings.getRegisteredGroup, Settings.getUnloggedinGroup));
|
||||||
permsMan.addGroup(player, realGroup);
|
return permsMan.addGroup(player, realGroup);
|
||||||
break;
|
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user