summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager/src
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
commit25bd91eb807e19db9d045c8e5f4ee70ec085da33 (patch)
treedabd99486be2c4274c1390e7ae29112881aab642 /EssentialsGroupManager/src
parentbd7af593e7e77df0d59f32cf5b3b7d4170682af3 (diff)
downloadEssentials-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')
-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