Remove all permission attachments when performing a manload or restart.

This commit is contained in:
ElgarL 2012-04-06 12:53:36 +01:00
parent bd7af593e7
commit 25bd91eb80
3 changed files with 14 additions and 1 deletions

View file

@ -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).
- 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.

View file

@ -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

View file

@ -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