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 | 55433e2288238d06a35fe1a81e832d2510d91429 (patch) | |
tree | b2cbe5f8925854727862a7c8c879b3e712423cd0 /EssentialsGroupManager | |
parent | c3225d16071564f2a1ad52f4c3c4d69ca38eabe3 (diff) | |
download | Essentials-55433e2288238d06a35fe1a81e832d2510d91429.tar Essentials-55433e2288238d06a35fe1a81e832d2510d91429.tar.gz Essentials-55433e2288238d06a35fe1a81e832d2510d91429.tar.lz Essentials-55433e2288238d06a35fe1a81e832d2510d91429.tar.xz Essentials-55433e2288238d06a35fe1a81e832d2510d91429.zip |
Remove all permission attachments when performing a manload or restart.
Diffstat (limited to 'EssentialsGroupManager')
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
|