- 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) { public void saveData(Player player) {
String id = Utils.getUUIDorName(player); String id = Utils.getUUIDorName(player);
Location location = spawnLoader.getPlayerLocationOrSpawn(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 operator = player.isOp();
boolean canFly = player.getAllowFlight(); boolean canFly = player.getAllowFlight();
float walkSpeed = player.getWalkSpeed(); float walkSpeed = player.getWalkSpeed();

View File

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

View File

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