Slit refreshPermissions() in multiple functions
This commit is contained in:
parent
79bc01d986
commit
4bac4a1d70
@ -145,21 +145,29 @@ public class SimplyPlugin extends JavaPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
protected void refreshPermissions() {
|
||||
protected void refreshConfig() {
|
||||
try {
|
||||
getConfig().save(configFile);
|
||||
reloadConfig();
|
||||
} catch (IOException e) {
|
||||
getLogger().warning("Failed to write changed config.yml: " + e.getMessage());
|
||||
}
|
||||
for (String player : permissions.keySet()) {
|
||||
}
|
||||
|
||||
protected void refreshPlayerPermissions(String player) {
|
||||
refreshConfig();
|
||||
PermissionAttachment attachment = permissions.get(player);
|
||||
for (String key : attachment.getPermissions().keySet()) {
|
||||
attachment.unsetPermission(key);
|
||||
}
|
||||
|
||||
calculateAttachment(getServer().getPlayer(player));
|
||||
}
|
||||
|
||||
protected void refreshPermissions() {
|
||||
refreshConfig();
|
||||
for (String player : permissions.keySet()) {
|
||||
refreshPlayerPermissions(player);
|
||||
}
|
||||
}
|
||||
|
||||
public ConfigurationSection getNode(String node) {
|
||||
|
Loading…
Reference in New Issue
Block a user