diff options
author | ElgarL <ElgarL@palmergames.com> | 2012-04-06 12:53:36 +0100 |
---|---|---|
committer | ElgarL <ElgarL@palmergames.com> | 2012-04-06 12:53:36 +0100 |
commit | 25bd91eb807e19db9d045c8e5f4ee70ec085da33 (patch) | |
tree | dabd99486be2c4274c1390e7ae29112881aab642 /EssentialsGroupManager/src | |
parent | bd7af593e7e77df0d59f32cf5b3b7d4170682af3 (diff) | |
download | Essentials-25bd91eb807e19db9d045c8e5f4ee70ec085da33.tar Essentials-25bd91eb807e19db9d045c8e5f4ee70ec085da33.tar.gz Essentials-25bd91eb807e19db9d045c8e5f4ee70ec085da33.tar.lz Essentials-25bd91eb807e19db9d045c8e5f4ee70ec085da33.tar.xz Essentials-25bd91eb807e19db9d045c8e5f4ee70ec085da33.zip |
Remove all permission attachments when performing a manload or restart.
Diffstat (limited to 'EssentialsGroupManager/src')
3 files changed, 14 insertions, 1 deletions
diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 2cfe57f62..a9355e608 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -164,4 +164,5 @@ v 1.9: v 2.0:
- Fix GM reporting of permission inheritance to retain the correct order. Lower inheritance groups can no longer negate a higher groups permissions.
- Fix an error I caused trying to modify an unmodifiable list when parsing '*' permissions.
- - Don't throw errors when attempting to remove permission attachments (bukkit will have already removed it).
\ No newline at end of file + - Don't throw errors when attempting to remove permission attachments (bukkit will have already removed it).
+ - Remove all permission attachments when performing a manload or restart.
\ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index 8bd346735..d1c62d4de 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -106,6 +106,9 @@ public class GroupManager extends JavaPlugin { } WorldEvents = null; + + // Remove all attachments before clearing + BukkitPermissions.removeAllAttachments(); BukkitPermissions = null; // EXAMPLE: Custom code, here we just output some info so we can check that diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java index 6df18cb05..3b66c1eb9 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java @@ -362,6 +362,15 @@ public class BukkitPermissions { attachments.remove(player);
}
}
+
+ /**
+ * Remove all attachments in case of a restart or reload.
+ */
+ public void removeAllAttachments() {
+
+ for (Player player : attachments.keySet())
+ removeAttachment(player);
+ }
/**
* Player events tracked to cause Superperms updates
|