summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2012-04-06 12:53:36 +0100
committerElgarL <ElgarL@palmergames.com>2012-04-06 12:53:36 +0100
commit55433e2288238d06a35fe1a81e832d2510d91429 (patch)
treeb2cbe5f8925854727862a7c8c879b3e712423cd0 /EssentialsGroupManager
parentc3225d16071564f2a1ad52f4c3c4d69ca38eabe3 (diff)
downloadEssentials-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')
-rw-r--r--EssentialsGroupManager/src/Changelog.txt3
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java3
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java9
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