- Set group to empty if permissions manager has no group support.

- edited comment for config node "permission.EnablePermissionCheck"
This commit is contained in:
DNx5 2016-08-19 18:40:47 +07:00
parent 9726576907
commit 78708354e1
3 changed files with 9 additions and 7 deletions

View File

@ -87,7 +87,10 @@ public class PlayerDataStorage {
public void saveData(Player player) {
String id = Utils.getUUIDorName(player);
Location location = spawnLoader.getPlayerLocationOrSpawn(player);
String group = permissionsManager.getPrimaryGroup(player);
String group = "";
if (permissionsManager.hasGroupSupport()) {
group = permissionsManager.getPrimaryGroup(player);
}
boolean operator = player.isOp();
boolean canFly = player.getAllowFlight();
float walkSpeed = player.getWalkSpeed();

View File

@ -156,10 +156,9 @@ public class LimboCache {
}
private void restoreGroup(Player player, String group) {
if (!settings.getProperty(PluginSettings.ENABLE_PERMISSION_CHECK)
|| !permissionsManager.hasGroupSupport() || StringUtils.isEmpty(group)) {
return;
if (!StringUtils.isEmpty(group) && permissionsManager.hasGroupSupport()
&& settings.getProperty(PluginSettings.ENABLE_PERMISSION_CHECK)) {
permissionsManager.setGroup(player, group);
}
permissionsManager.setGroup(player, group);
}
}

View File

@ -45,8 +45,8 @@ public class PluginSettings implements SettingsClass {
newProperty("settings.messagesLanguage", "en");
@Comment({
"Take care with this option; if you don't want",
"to use Vault and group switching of AuthMe",
"Take care with this option; if you want",
"to use group switching of AuthMe",
"for unloggedIn players, set this setting to true.",
"Default is false."
})